• Canadian Developer Connection

    A Vision Needs a Roadmap

    • 2 Comments

    image

    You know the projects you’re currently working on and the technologies you use to get them done. But what about future projects? What would they be using? The people that can answer that are the developers and architects that not only keep themselves up to date with technologies of today, but that also know what’s coming tomorrow and how to get there.

    On February 22, you’ll have the opportunity to be one of those developers and architects. Join me in the Developer and Software Architect track as I take you through an exploration into the many new ways your investment in Microsoft technologies can drive innovation, productivity, efficiency, and potential cost savings. We’ll talk about what you’re doing, your challenges, and your needs, and answer any business or technical questions you may have.

    Here’s what the event will look like:

    8:00 - 8:30am Registration and Breakfast
    8:30 - 9:00am Keynote- Microsoft's Enterprise Vision
    9:00 - 9:15am Windows Devices Showcase
    9:15 - 9:30am Break
    9:30 - 10:15am The Public Cloud, Windows Azure™, and Your Enterprise
    Discover when and how you can use Windows Azure™, Microsoft’s public cloud platform, as part of your enterprise solutions. You’ll take a look at the parts that make up the platform and scenarios where you can leverage them. The discussion will then dive deeper, focusing on the key architectural elements that need to be taken into consideration when moving to Windows Azure.
    10:15 - 11:00am Enterprises Go Mobile with Windows Phone 7
    In this session, you’ll explore how enterprises can improve employee productivity by using Windows Phone. You’ll learn how Windows Phone helps enterprises get employees access to their information while mobile, how to extend/build LOB applications to use mobile devices, and how the integration with Microsoft Server products and services leads to a smooth deployment of Windows Phone across the workforce. Case studies of how customers are using mobile devices in the Enterprise will also be shared.
    11:00 - 11:15am Break
    11:15 - 12:00pm In the Real World
    When looking to make decisions that will impact the direction of your solutions, enterprise standards, infrastructure, tooling, etc, there are always many questions to ask. To get the best possible answers, it is best to ask those who have experience architecting, developing, testing, and implementing solutions in the “real world”. This interactive discussion will give you an opportunity to ask experts, those who have “real world” experience, your questions. You’ll hear about enterprise scenarios they have encountered, problems they have solved, and the benefits and hurdles they encountered along the way.
    12:00 - 12:15pm Thank you

    Register Today

    There’s no charge to attend so make sure you register today.

    Register >>

    Some more details

    If you’re interested, you can also attend other tracks – you’ll just have to register for those separately. Here’s the information you need for those:

    I look forward to seeing and connecting with you there,

    **Please note that this is an NDA event. If your organization does not have a signed Non Disclosure Agreement in place please contact your account manager to make the proper arrangements

  • Canadian Developer Connection

    Learn, then Drink to Celebrate!

    • 0 Comments

    CampChallenge

    Even though it hasn’t really been a typical winter for many areas across the country, it’s still cold enough for most of us to want to stay inside. The question is, what are you doing with your indoor time? If you’re like me, this is the time to catch up on the latest and greatest, taking the time to sit and learn something new.

    If you’ve had a chance to watch the D³: LIVE & INTERACTiVE special with Paula Rainford, Current IT Market Conditions and Hiring Trends in 2012, you know that the need for developers with Cloud Computing knowledge and skills is increasing. So, take that as a sign, or a forcing function if you will, and try out something new, expand your skill base and become either a Hero in your current company or more attractive for new companies.

    2502.AzureCamp_5F00_32BE32F8[1]If you’re wondering why Cloud Computing and Windows Azure skills and knowledge are being sought after by companies of all sizes, watch the Windows Azure Camp Online videos that teach you all about Windows Azure and what you can do with it. If you prefer to learn in-person with an instructor, look for a Windows Azure Camp in a city near you.

    If the industry demand or the things you can do with Windows Azure aren’t enough to get you interested in getting the jump on your skills adjustment and checking out what the Windows Azure platform can do, how about I sweeten the deal for you? The title of this post is Learn, then Drink to Celebrate for a reason right?

    Learn

    I believe the best way to learn is by trying. Here’s what you’ll do:

    1. Download the Introduction to Windows Azure hands-on lab.
    2. Follow the steps in the lab manual to complete the lab. If you prefer to work backwards, you can start from the completed solution (also included) and look at the code to understand what’s going on.
    3. When you’ve completed the entire lab, take two screenshots like those below, showing the complete DNS name of your hands-on lab and all of the instances running in production.

      image 

      image

    4. Send your lab’s DNS name (something.cloudapp.net), your mailing address, and the two screenshots to cdnazure@microsoft.com.

    That’s it! I do recommend watching the Getting Started with Windows Azure video, but that’s entirely up to you.

    Drink to Celebrate

    So why bother doing all of the above? Seeing how easy it is to start using Windows Azure with your existing applications, of course! Aside from that, I’ll be sending you a gift card for about 5 drinks so that you can reward yourself for learning something new. You’ll be on your way to becoming the Cloud guru at your company in no time.

    IMPORTANT: Make sure that you don’t stop or delete your deployment until you hear from me. I have to verify that you completed the lab, so your lab needs to be accessible at the DNS name you submit.

    (By the way, the drinks are from a famous Canadian coffee retailer whose name rhymes with Jim Morton’s. What kind of drink did you think I was talking about?)

    So…

    Don’t Delay – I’ve only set aside a certain number of cards. Once they are gone – they are gone! And before anyone asks – this offer is valid and available to Canadian developers who deploy their hands-on labs to their Windows Azure accounts. Those accounts can be Windows Azure trial accounts (you can get a free one for 90 days), MSDN, BizSpark, or MPN Windows Azure benefit accounts as long as you don’t have any other deployments in the account*.

    Enjoy!

    * Offer good only in Canada and is available to the first 200 individuals, including residents of Quebec, who complete the hands-on lab, are verified by the Microsoft Canada Team, and have received a verification email from cdnazure@microsoft.com. Limit one gift per person. The gift is a $10 Tim Horton's gift card. The offer is non-transferable and cannot be combined with any other offer. Due to government gift and ethics laws, government employees are not eligible to participate. This offer is valid until all 200 gifts have been awarded. Any gift returned as non-deliverable will not be re-sent. Please allow up to 3 weeks for verification and 6-8 weeks for delivery of your gift which will be provided to you via mail. We reserve the right to substitute a gift of equal or greater value.

  • Canadian Developer Connection

    Ok. Let’s Start from the Beginning.

    • 0 Comments

    One of my favorite things to do is to check and see what folks are talking about on that Internet thing and one of the people I enjoy reading is the handsome and dapper Martin Beeby who we lovingly refer to as “The Beebs”. He is a developer evangelist for Microsoft and loves HTML5 just like me, but because he is on the other side of the world, he tends to see things before I do (grrr!).

    The past few days, it has been interesting that folks have been asking me about how to get up-to-speed on HTML5. Like The Beebs wrote today, I ran into kids this weekend (I was at a way cool gaming hackathon event) and was asked multiple times how to get started with HTML, CSS and JavaScript. What I enjoyed was that they were not ashamed to say they didn’t know something. It is too bad that grown ups feel like they have to know everything.

    Now, everyone typically has their stock answer, but I am always intrigued by new ways to learn and have been trying to find good material that actually have some design sensibilities as most of the good stuff looks like it was designed by a monkey with finger paints harkening back to web design circa 1997. But I digress…

    As I am always looking for new things to help folks design or build amazingly brutal web apps, I have found a few things I am going to review and start recommending for those new to the web world.

    Based on text: A Beginners Guide to HTML and CSS

    This website is nicely done with good typography and a clean layout. Even the ampersands are beautiful. Shay Howe does a great job of describing the fundamentals while not doing to typical element by element linear way of teaching, but organizing it in a coherent way.

    image

    Based on book: HTML & CSS -- design and build websites

    Unfortunately, it isn’t hip these days to actually read printed paper. Hipsters will proclaim “I am all digital bro”. Fine. But then I saw HTML & CSS in a beautiful and colorful format and I just had to order it. Mine should arrive tomorrow and promise that at some point I will write a book report about it.

    Do kids in school do book reports still? Let me know in the comments. Oops, I digress…

    image

    Based on video: Treehouse

    Treehouse is a video website that teaches a variety of web design and development subjects and uses a badging system to keep you engaged and motivated. It is a monthly sign-up which gives you access to a wide coverage of topics including the fundamentals.

    image

    What Now?

    You can consume all of the content there is on the planet about HTML and CSS, but that does not mean that you will become an expert. The number one way to learn is to DO IT! I recommend folks not only find good content like those provided above, but to then take that knowledge and apply it to an app that you would like to build. Also, feel free to create experiments as you may be surprised at what you will learn.

    How did you learn the fundamentals of HTML and CSS? Let us know below!

  • Canadian Developer Connection

    Windows Phone links for the week

    • 0 Comments

    A good number of us from the team are in Redmond this week on our annual pilgrimage to the mothership (Microsoft Headquarters) for training, so content from me will be a little lighter than usual.

    As a result, I wanted to share with you a set of links and resources that are new to help you learn more on Windows Phone development and also a reminder of some older links that you might want to bookmark as well.

    Happy coding!

    Five-Part Series on Metro Design

    A five-part series on Metro design for Windows Phone.
    31 Weeks of Metro Design for Windows Phone An in-depth discussion on the topic of Metro for Windows Phone by Arturo Toledo (Senior User Experience Designer for Windows Phone).  A weekly post series currently in motion.

    Five-Part Series on Succeeding on the Windows Phone Marketplace

    A five-part series on strategies you can use to increase the adoption and downloads of your app/game on the Windows Phone Marketplace.

    Webcast:  A lap around Windows Phone 7.5 Link to a 3 hour webcast I presented on implementing features of Windows Phone 7.5 in your apps today.
    Microsoft Canada Windows Phone Developer Resources Page A page outlining a number of great resources to get you started on Windows Phone development and resources that can help you after you’ve become familiar with Windows Phone development.
  • Canadian Developer Connection

    D³ Special Edition: Current IT Market Conditions and Hiring Trends in 2012

    • 0 Comments

    On this D³: LIVE & INTERACTiVE special, the D³ crew goes on location, visiting the East of Toronto .NET User Group where Paula Rainford, Account Manager at TEKSystems in Mississauga, ON speaks about industry trends as they relate to the .NET development community. Paula shares specific networking and job hunting techniques to assist in landing that next opportunity. Plus: Paula zeros in on what employers are looking for in candidates and what should be expected out of recruitment firms.

    Highlights

    • [02:24] Current IT market conditions in Canada
    • [04:50] The debate of going into contracting or full time permanent positions
    • [05:00] Outlook for 2012
    • [06:36] Top skills sets desired in 2012
    • [06:57] Huge demand for mobile development
    • [07:20] Developers with Microsoft skills are high in demand
    • [08:00] Increase in the use of Microsoft development to convert legacy systems over Java
    • [08:38] The need for user experience designers
    • [09:23] #2 top skill: Security
    • [09:41] #3 top skill: Data warehouse/business intelligence
    • [10:19] #4 top skill: Networking
    • [10:46] #5 top skill: Business analysis/project management
    • [11:20] #6 top skill: IT Pro
    • [11:53] What employers are looking for
    • [13:26] Q: Can you elaborate on “soft skills”?
    • [14:30] Bad hires are due to attitudinal reasons
    • [15:26] Q: You said that one of the biggest challenges is attracting new people. Is that because the bar is set too high?
    • [17:10] Q: What are employers defining “emotional intelligence” as?
    • [17:49] Job hunting skills: networking
    • [18:44] Importance of referrals
    • [19:26] Working with recruitment firms to land an opportunity
    • [20:42] Using LinkedIn as your social network
    • [23:00] Job hunting using Twitter
    • [23:47] Other avenues you can use to locate opportunities
    • [25:10] What to expect from recruiting firms
    • [27:09] Q: How do recruiting firms work with people who have experience, just not Canadian experience?
    • [28:20] Q: What are you seeing happening so far in 2012?
    • [28:54] Q: What’s your take on certification?
    • [29:21] Q: Do employers still require college or university degrees to get jobs?
    • [30:23] Q: What are companies doing to attract talent?
    • [31:50] Q: Are people who move around jobs a lot more marketable than those who stick around for longer periods of time?
    • [33:03] Q: What are you looking for in resumes?
    • [33:35] Common employer resume frustrations
    • [34:18] Q: Is it true that resumes should only be two pages?
    • [34:51] Q: How many resumes do employers look at for positions?

    Paula Rainford
    Paula is a tenured Account Manager with TEKsystems with a background in recruiting. She manages the relationship between corporations and TEKsystems and is dedicated to spending time to develop an understanding of a company's culture, hiring practices, upcoming business priorities and IT project and resources needs. She is actively involved in networking and recruiting the top IT talent and assisting technical professionals in their career search.
    Contact >>

    TEKSystems
    teksystemsTEKsystems is North America's leading technology staffing and services company. Combining a proven track record of superior performance, a quality focused approach to service delivery and the highest calibre technical professionals in the market, TEKsystems helps our clients successfully plan, build, and run their critical technology initiatives. With more than 25 years of experience, we annually deploy 70,000 technical professionals from 90 locations through North America, Europe and Asia.

    East of Toronto .NET User Group

    easttorontougThe mission of the East of Toronto .NET Users Group is to provide advanced, interesting information about the Microsoft .NET Framework. It serves the need of developers to receive the best .NET programming information, and fill their desire to be informed about developments of revolutionary importance as early as possible. The group serves the needs of programmers who are currently working with or interested in the .NET platform.

    D³: LIVE & INTERACTiVE
    Just in case you haven’t heard about the show, Developers, Developers, Developers: LIVE & INTERACTIVE (D³) is a monthly show hosted by yours truely. The show airs live every first Wednesday of the month at 12:00 PM ET and features the latest updates on what's new and exciting in the world of development; featured presentations; and guests. LIVE and INTERACTIVE means that you'll be part of the show – You're invited to interact with us; ask questions and get them answered; and share your thoughts and opinions.

     Join the Canadian Developer Connection LinkedIn group
     follow @devsdevdevs, or
     like D³ on Facebook.

    More >>

    Special thanks to Paula and the East of Toronto .NET User Group for inviting D³ and allowing us to share this special with developers nationwide.

  • Canadian Developer Connection

    Do you hate SharePoint? Part 3 of 4

    • 0 Comments

    If the answer is yes, could your hatred be caused by your local implementation? In this blog series we look at four common problems with SharePoint implementations and how you can address them.

    We continue our series by Neil McIsaac, SharePoint MCT, for putting this together. Happy reading! If you missed it you can still read Part 1 and Part 2 of the series

    SharePoint is an interesting platform and as it grows as a product and with its already incredible adoption, it is an important cornerstone for many organizations. But ask the people that work with it, and you will find a divided love it or hate it passion for the product.

    Why hate it?

    It’s my experience (which dates back to the site server/dashboard days), that many customers have difficulty handling the product and I mean this a number of ways. Here’s the issue:

    SharePoint will amplify your problems.

    So why do we hate it? I would hate anything that made my problems larger. But did SharePoint create the problem? That would be like blaming the carpenters hammer for building a crooked house. The problems are our own doing in the majority of cases. In my experience, the most common problem SharePoint seems to amplify are the following;

    1. Information Security
    2. Business Intelligence

    This week we look at Information Security.

    3. Information Security

    SharePoint has a confusing security architecture. A friend of mine continually jokes that you can do anything in SharePoint, as long as you know the 6 strategically placed security settings you need to set to allow users to interact with your content. I like to keep things simple. I always start addressing security by asking these 3 basic questions;

    What are the requirements?

    This question is pretty straight forward and we do it relatively well. Who gets access, and who doesn't.

    How do we know we meet the security requirements?

    This is one area where SharePoint poses some difficulty, since it lacks any worthwhile reporting tools and has enough security layers that are hidden in the UI that it feels like finding an answer to this question is akin to finding the meaning of life itself. Paired with the products inability to properly handle security inheritance and the lack of a proper method to deny permissions and you are on a never ending hunt for individualized permissions. Yuck. Unfortunately the best security reporting tools are third party. Your team needs to sit down and address how your organization will address security reporting and auditing.

    When is the last time we checked?

    Security audits are often checked at implementation, but rarely checked afterwards. Permission elevation happens for various reasons such as troubleshooting, making it necessary to schedule our audits. If running an audit is painful because we haven't properly addressed the above question, then scheduling it will hurt that much more. Again, get a good security tool.

    Information Security Tips

    Here are a few tips on implementing security in SharePoint to help make things a little more manageable.

    Libraries/Lists are for security

    I am not a fan of the Shared Documents Library which comes as a default. If you have ever heard me talk on the subject, you know I get a bit worked up about it. I am a fan of lists/libraries in SharePoint and I completely understand Microsoft's position in adding it. It was a necessary evil. The problem that I have with it is what most people put in it. It goes against pretty much every information management principal that we have. Many organizations use this library and why not? It says "Shared" and I want to share my stuff, so why not? The reasons are many, but at a simple level, you will end up with a folder structure that mimics your old file shares, and make it work by placing individual permissions on folders and files to compensate for your lack of proper architecture. If you think of lists and libraries as containers, which if you were paying attention in the previous blog post when I ranted about the importance of structure, you can shape these containers to better store its information. You can change the shape (think 'content types'), and you can change the behaviour (think 'workflows' and 'views') to better aid the end user in the task they have at hand (think 'Use Cases'). Coming back to permissions, if we have a container with similar information in it, we can control permissions to all of its content by controlling permissions to the container. In other words, permissions in SharePoint are best handled at the list and library level and not at the folder or file/item level. Which brings me to a solid point: If you are not sure how many libraries you should have, look at the common permissions to your content. If a group of people need read access to one type of content but not to another type of content, then the content should be in the same list/library and we can control permissions to the content by setting the permissions once on the list or library. So how many lists or libraries should you have? The answer is in how many groups of content with the same permissions you have. This is not always the answer, but it is a good starting point.

    Use SharePoint groups as functional roles

    SharePoint groups are best used to reflect functionality rather than entity. Since we typically use Active Directory groups, adding the AD groups to our SharePoint groups to reflect the same group would be redundant. For example, having a Sales group in AD, which we mimic and create a Sales group in SharePoint usually offers little benefit. Having a group in SharePoint that reflects their ability is preferred. For example, I can create a group in SharePoint called Sales Lead Generators that can better reflect what anyone in that group can 'do' rather than who they are. Not only does it simplify security administration, it makes audit reporting a lot easier to read and verify.

    Use Information Rights Management

    Information Rights Management has been around for some time now. Surprisingly, most organizations that want to secure documents rely on securing the folder or physical media where the file is stored. The problem is that this security simply doesn't follow the document where ever it goes. IRM on the other hand, does! You just have to ask someone if their documents are just as secure after an employee that has proper permissions to the file copies it to a thumb drive, or inadvertently emails it to the wrong person. SharePoint and IRM integrate very well. You can check out more about IRM here.

    Next week, part 4 business intelligence…

  • Canadian Developer Connection

    On the Next D³: LIVE & INTERACTiVE – Securing .NET Applications

    • 0 Comments

    On The Next D3

    February 1, 2012 | 12:00 PM ET | Add to Outlook >>

    Next week on Developers, Developers, Developers: LIVE & INTERACTiVE: Developer security experts and TechDays speakers Joël Herbert and Steve Syfuhs will be will be on the show to chat about securing .NET applications easily and effectively.

    Plus: Gladstone Grant, VP of Microsoft Canada’s Developer & Platform group, will be talking about the directions of IT and the opportunities developers have working with Microsoft platform. Watch Gladstone’s Directions of IT: The Developer Opportunity, then tune in, and ask him your questions.

    All LIVE and INTERACTiVE.

      joel_hebert_138x117 SteveSyfuhs
    Gladstone 

     Connect with D³

     Follow @devsdevdevs    Like D³ on Facebook    Join the Canadian Developer Connection LinkedIn group

    Developers, Developers, Developers Home >>

    Only a week to go before the next D³, so make sure to save the date and time (you can use the Add to Outlook link above)!

  • Canadian Developer Connection

    Winning on the Marketplace: Where in the world are you publishing?

    • 2 Comments

    If you’ve built modern mobile apps, you probably already know that coming up with the idea for the app/game and coding it is really only half the battle.  Success is largely determined in the marketing strategy you adopt for your app.  There are quite a few strategies that you can take and you can likely mix and match them, but there is no one “silver bullet” that will make your app an instant success.  This post is the first in a series of five that will give you an idea of some of the ways you can help your app become a success in the Windows Phone Marketplace.

    toughThere’s a statistic that was published by analytics vendor Localytics that states that only 26% of all mobile apps downloaded are ever opened more than once.  That’s actually a little higher than the numbers I’ve heard around mobile app circles, but still that number is quite astounding.  What it means is that for a myriad of reasons, most users are interested enough to open your app but quickly lose interest and either delete right away or never open it again.  Those odds are not good, so if you intend for your app to be popular, you need to adopt a strategy that will give you an edge and compel your user base to make use of your app more than once.

    There are multiple things you need to do before your app is ready for consumption.  One is to have a great idea (this is pretty much non-negotiable in my opinion).  Second, you need to build it the right way (i.e.:  great functionality, application flow, pleasant interface and intuitive app design). Third, you need to figure out a way for your app to make your users awesome in the moment.  All this before your very first user even thinks of downloading your app. 

    At the same time as building your app, you should be thinking about how you’ll market it once it’s ready.  Over the next 5 days, I’ll be posting an entry per day discussing some of the strategies you can employ to help make your app or game more successful on the Windows Phone Marketplace.

    Making your apps available on as many markets that make sense to support, not ALL markets possible

    The context of this first post is about understanding which geographies you can make your app available in.  Your first answer to “which countries should your app be available in?” might be “All of them, of course!”, but keep in mind a few things.  The correct answer to this question is that you should assess which countries your app will have value to users and how you will be able to support those users with your app.

    For example, there is a fantastic app called “Where’s Timmy?” that RedBit Development created and published that is a consistently popular one in Canada.  While there is nothing that limited Redbit from making the app available in every single market, the purpose of the app is to locate the closest Tim Horton’s coffee shop from your location.  Tim Horton’s is very popular in Canada and growing in popularity in the US, but has no presence in Europe.  As a result, Redbit did not publish the app in European countries but did publish it in Canada and the US.

    Another consideration to take into account is localization.  Making your app available in many markets may require you to support many different languages for your apps.  You must make a judgment call as to which languages you wish to support.  While this adds to the complexity of your app from a maintainability perspective, it enhances the local user’s experience while using the app.  By localizing the content of your app to the appropriate language and culture considerations, you will likely have better adoption and better ratings for your app in the Marketplace.

    Markets Supported by Windows Phone

    So with that said, what markets are currently supported by Windows Phone?  The graphic below shows which markets are supported (countries highlighted in yellow are markets that have been supported since launch in November, 2010 while markets highlighted in green were added just recently).

    SupportedMarkets

     

    Marketplace distribution and targeting the right locales is one of the strategies for being successful in the Windows Phone Marketplace.  Stay tuned for further Marketplace strategies over the next few posts on the Canadian Mobile Developer Connection, where I’ll talk about the trial API, pricing strategies, differentiation using Windows Phone-specific features like Live Tiles and Push Notifications and finally, how you can get promoted in the Windows Phone Marketplace.

  • Canadian Developer Connection

    Javascript and CSS Minifying/Bundling with the Microsoft.Web.Optimization Nuget package

    • 0 Comments

    photoThis blog post is a guest post from Maxime Rouiller. If you want to make blog post about Web technology, please contact me at fredh@microsoft.com.

    Maxime Rouiller is a passionate .NET technology specialist and ASP.NET MVP, working for 8 years in large software development, advocating Agile and TDD. Aware of the latest technological trends, he intervenes as a specialist in the .NET Montreal usergroup and acts regularly as a speaker for Web Form programmers on the MVC platform.

    So I’ve been wanting to write about this since the build and only gotten around to do it now.

    When you write C# code, you rather have multiple small files with clear separation of concerns. This allows you to have small and clear classes, and the compiler will never complain about it. However, in Javascript, you want to have smaller files. Most of the time in the .NET environment, there wasn’t any integrated way of doing so. Either it required an EXE call or outputing .min.js files.

    This caused problems as we had to alter our Development version of our HTML to fit our Production environment. Microsoft released this tid bit early because it’s probably going to be integrated in the .NET 4.5 framework but is making it available to us now.

    Please be aware that “Microsoft.*” DLLs are not part of the official framework and when they do, they will probably be changed namespace to “System.*”.

    Pre-requisites

    First, you will need NuGet to install the following packages:

    • Microsoft.Web.Optimization
    • WebActivator

    How it works

    Now, the way the JS/CSS minifying works is that it will dynamically inspect all your files, read them, minify them and then cache the result to be served later. This allows us to modify our files and have all the files re-minified. When one of our JS/CSS files get modified again, this process will restart until either the cache expires or a file change.

    Setting up the base work

    For the minify-er to work, it will require the registration of a HttpModule. It’s not already included in the Microsoft.Web.Optimization package, but it will be necessary for us to add it if we want it to work.

    using Microsoft.Web.Infrastructure.DynamicModuleHelper;
    using Microsoft.Web.Optimization;
    using MvcBackbonePrototype.Bundle;
     
    [assembly: WebActivator.PreApplicationStartMethod(typeof(MvcBackbonePrototype.AppStart.BundleAppStart), "Start")]
     
    namespace MvcBackbonePrototype.AppStart
    {
        public static class BundleAppStart
        {
            public static void Start()
            {
                DynamicModuleUtility.RegisterModule(typeof(BundleModule));
                RegisterFolders();
            }
     
            private static void RegisterFolders()
            {
                // configure Microsoft.Web.Optimization
            }
        }
    }
     

    The previous code will do the following, when your application start, it will register a dynamic HttpModule.

    Now that the base work is done, we’ll jump right ahead to the configuration of the folders.

    Configuring the package

    Now that the HttpModule is properly registered, we need to tell the Module when to activate itself. In my specific scenario, I wanted to have jQuery, underscore.js and Backbone.js in that specific order.

    By default, the Module will load most core frameworks first (jQuery, MooTools, prototype, scriptaculous) and then load the rest of the files that doesn’t match the wildcards after. The filters are done so that jQuery plugins will load after the jQuery core library, and jQuery UI will load after jQuery.

    However, there is nothing done for underscore.js and Backbone.js.

    private static void RegisterFolders()
    {
        var js = new DynamicFolderBundle("js", typeof(JsMinify), "*.js", false);
        BundleTable.Bundles.Add(js);
    }

    The previous code correctly configures the module to minify all files in a folder by just adding the suffix “js” to the folder (eg.: /Scripts/js).

    However, it will register the other modules in alphabetical order rather than the proper order.

    Let’s fix that.

    Custom Orderer

    public class BackboneOrderer : DefaultBundleOrderer
    {
        public override IEnumerable<FileInfo> OrderFiles(BundleContext context, IEnumerable<FileInfo> files)
        {
            context.BundleCollection.AddDefaultFileOrderings();
     
            var backboneOrdering = new BundleFileSetOrdering("backbone");
            backboneOrdering.Files.Add("underscore.*");
            backboneOrdering.Files.Add("backbone.*");
            context.BundleCollection.FileSetOrderList.Add(backboneOrdering);
     
            return base.OrderFiles(context, files);
        }
    }

    We first inherit from the default order. Then, we add the default file ordering, which will take care of the jQuery ordering for us. Then, we add the other files that we require to the list. The only thing left is to alter our RegisterFolders method to fix that.

    private static void RegisterFolders()
    {
        var js = new DynamicFolderBundle("js", typeof(JsMinify), "*.js", false);
        js.Orderer = new BackboneOrderer();
        BundleTable.Bundles.Add(js);
    }

    That’s it. We are nearly done!

    Modifying your _Layout.cshtml / masterpage

    My masterpage head section first looked a lot like this:

    <script src="@Url.Content("~/Scripts/Framework/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Framework/underscore.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Framework/backbone.min.js")" type="text/javascript"></script>

    This was of course replaced by the following:

    <script src="@Url.Content("~/Scripts/Framework/js")" type="text/javascript"></script>

    And that’s all! All your files will be minimized, bundled and properly cached.

    Bonus

    If you want to have your URLs with a “version number” on it, I suggest that you use the following methods to resolve your URLs instead of the MVC way:

    <script src="@Microsoft.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Scripts/Framework/js", true)"></script>
  • Canadian Developer Connection

    Canada Does Windows Azure: Druida

    • 0 Comments
    Canada Does Azure Background

    I believe that the best way to learn is to learn from each other, so I’m always on the search for stories of Canadian developers who have either built new applications using Windows Azure services or have migrated existing applications to Windows Azure. This is the story of Druida.

    Key Points

    • [04:33] (Mapping on-premises components to Windows Azure):
      “For the application server, the Web Role is typically our application server. The file server, also, is Blob storage. On-premise they [customers] have the storage [server] to put the files. Now you have blobs to put the files. It is exactly the same, the only thing is that the application server, the Web Role, processing the information it checks – ‘I’m in Azure, ok, let’s go to Blob Storage. I’m not in Azure, I go to the storage server.’”
    • [05:41] (Learning curve of a .NET developer to the Cloud):
      “From the developer perspective, the learning curve is kind of easy. The challenge was to make it work in a seamless way for the emulator to put all of the different pieces of Azure together. … It wasn’t the language experience of the developer, it was more the meta stuff, the stuff that goes on top to make Azure work that is more of a steeper curve. … From the point of view of a developer, there was nothing, there’s was not much to learn.”
    • [07:45] (Architectural challenges):
      “… the config files. Because in Azure, when you put stuff there, the web.config is kind of locked, and it gets deployed to the roles. To make changes, I have to redeploy everything. So what we did (that was one of the biggest changes), we took out the information from the web.config and put it into a blob… that will trigger an event called RoleEnvironment_Changed on the VMs so they know that something changed in the config file and they go and get the new one [Continues]”
    • [09:42] (Rationale of going to Windows Azure):
      “We had business reasons and technical reasons. On the business side, one is that we are not kind of a company that will be proud of having a lot of servers and a lot of infrastructure to take care of, a lot of databases, so when we had to provide offsite services to our customers, it was not a good idea to grow the company on things that we are not experts. … to have someone, like Microsoft, to take care of all of the infrastructure so the customers don’t need to take care of that, we don’t have to take care of that, so we have this middle area that do the best thing on that area – that was great. … On the technical side, the application was already multi-tenant, multi-lingual, had all of these pieces that matched perfectly onto Azure Web Roles, the blob, so it was not so hard – you don’t have to create a new team to do the Azure stuff, it was just ‘ok, you have the application, you did it in this way, it’s very easy, technically, to move it to Azure. [Continues]”
    • [13:15] (Obstacles and things that were not as obvious):
      “The configuration stuff was complicated and that was one of the challenges that we had to cope with. The other thing was logging. Logging was hard. Now it is much more mature. So when I speak about what were the challenges, sometimes you speak about something that is already solved. … It is very important to test it [your application] when you put it in Azure and not trust just what you have in the Compute emulator. It does a great job but sometimes there are some things that will not work exactly as they supposed to.”
    • [14:45] (Training resources):
      “MSDN. We tried to buy books, but actually you find that, at this era, sometimes books are too late. So you get the book and the information you’re reading then is misleading because you have the new SDK that has some changed parameters. … the good thing about the book is the introduction and the first chapter that talks about the architecture, the ideas, but when you get into the details, then the books are not useful. Finding stuff on the web and reading MSDN articles were the main sources of training.”
    • [15:45] (Understanding information from the web):
      “Looking at fragmented information from the web doesn’t give you the whole picture about the architecture of Azure. I think that it is good to have some kind of key books to read about – these introductory chapters … these first chapters speak a lot about how it is working, and that is very important. And sometimes if you go straight to developing, then you lose time, then you don’t know exactly why this is working this way. … Sometimes the why and the what is there at the beginning and then the how you find more on the Internet. … Sometimes time pressures make suboptimal solutions. So sometimes spending a little bit more time on learning the background allows you to make more informed decisions after.”

    More Windows Azure developer stories >>

    DANIEL FIRKA
    DanielDaniel Firka is the founder and CEO of DRUIDA Software & Consulting, chief architect, designer, and developer of the Druida SPAC software. He is an Industrial Engineer and a Sociologist, has obtained a MSc in Biomedical Engineering, and is currently finishing his MSc in Statistics at the University of Toronto. He is also a certified Quality and Reliability Engineer by the American Society for Quality (ASQ). He is a Director at the Argentinean Institute for Quality, and in his spare time, develops software for advanced biomedical applications.

    DRUIDA   
    DruidaDRUIDA is a company specialized in consulting and software development for Quality Assurance and Statistical Analysis. For almost 20 years it has developed a set of solutions covering several business needs related to Continuous Improvement, all under the flagship product named SPAC. The product discussed in this interview, SPAC IPP, as an auditing tool to evaluate suppliers and internal departments.

    Since its creation DRUIDA has leveraged Microsoft technologies to achieve high quality software. The latest innovation is the deployment of SPAC IPP on Windows Azure.

    More Windows Azure developer stories >>

Page 1 of 144 (1,437 items) 12345»