Some stuff about Web and .NET development
RSS icon Email icon Home icon
  • Visug summary : Modeling that works with code

    Posted on November 15th, 2009 Thibaut 2 comments


    Last Visug edition, animated by Marcel De Vries from InfoSupport, concerned modeling with Visual Studio 2010. Note before we start that all of this is only available in the ultimate edition of VS 2010.


    • Why we use models
    • Models first approach
    • Code first approach
    • Conclusion

    1. Why we use models

    • Diagrams for communication
    • Diagram = viewpoint on a model
    • Model use is challenging because :
      • Many interpretations of the same diagram
      • UML available but people uses a few diagrams only (ex : use cases)
    • Models become stale because :
      • Implementation will be different from the model
      • Maintaining diagrams takes time & effort
    • Ultimate goal : run a model (Oslo vision), from a metamodel store (data repository)

    When to create a model ?

    • It’s about communication, so create only models that serve a purpose
    • Create only models that differ from the normal case

    Two approaches

    • Models first
    • Code first

    2. Models first approach

    Scenario : you start a project and need to define the solution you’re going to build

    • Requirements analysts : use activity diagrams & use cases to outline functionality
    • Architects : build logial diagrams to outline required architecture to meet customer demand stated in the requirements
    • Testers : use the diagrams to do its test analysis based on the specified requirements
    • Developers can use the diagrams done previously to materialize the projects

    => Models are used to communicate throughout the team about what we’re going to do

    In Visual Studio 2010 Ultimate Edition :

    • New project type : modeling project
    • Support for UML 2.X diagrams
    • Other new types of diagrams : Layered diagrams & DGML diagrams

    Diagrams can be generated from code. The speaker uses it to generate sequence diagrams for code reviews. Note that those diagrams are plain XML files but it’s recommended to manipulate them via the API (cause in a next version, maybe Microsoft is going to change the format).

    3. Code first approach

    Scenario : maintenance of existing projects.

    • Developer can generate diagrams to gain insights on code dependencies
    • Architect can find architecture patterns
    • Architecture explorer helps discover and understand how a system works

    Layer diagram

    • Used by the architect to define the architecture
    • Classes and namespaces are mapped to layers in the diagram
    • Details the intended design
    • Diagrams are very interesting to verify the architecture and enfoce it.
    • In VS2010, there’s a tool to validate the architecture. Ex : you draw 3 boxes (UI, BLL and DAL), you link (arrow link) the UI to the BLL and the BLL to the DAL, you drag/drop your projects into the correct box. You then click “validate architecture” and you get a report about what’s violating the dependencies defined by the arrows.
    • You can also use these diagrams to validate things such as code coverage in percentage for a given layer.


    • Directed Graph Markup Language
    • Nodes
    • Containers
    • Links
    • Styles

    You can also create you own diagrams (Progression API). You code in C# the way you want to generate the diagram. Styles can also be defined. Ex : speaker coded a diagram with nodes that must appear green or red (styles) following the code coverage percentage. Can also be used to annotate existing diagrams.

    4. Conclusion

    • Models & diagrams primarily for communication
    • VS2010 supports both approaches : code 1st and models 1st
    • New innovations in models that work with code (DGML & layered diagrams)

    Also note that ScottGu is going to visit Visug in december so stay tuned ;)


  • Book review : Guidelines for Online Success

    Posted on November 11th, 2009 Thibaut No comments
    Guidelines for online success Written by industry experts, this book is a collection of best practices for web application and website development. Divided into 6 chapters (Interface & design, Marketing & Communication, Technology & Programming, Technical advice, Content/Content management and E-commerce) and widely illustrated, “do” & “don’t” are discussed about many notions of web development. Anyway, this book doesn’t assumes his title at all as it’s more a collection of pictures of nice websites than practices to follow. Even worse, among the few practices we’re given, many of them are completely unuseful and even redundant.


    • Full-color book
    • Very well crafted, original divisions into “tabbed” chapters with color schemes for each one of them


    • Absolutely not a collection of “guidelines”, too few text and way too many pictures
    • Some “guidelines” are completely dumb, such as “don’t make ugly layouts” and “don’t hide your navigation”
    • Because the book is written by many people, some “guidelines” are redundant. I was told at least 5 times in the book that “my website should not take too long to load”


    Absolutely not interesting about the “guidelines” aspect, but the book stills remains valuable if you’re using it like a “Web Design Index” for inspiration of best web productions.


  • Visug : lightweight stubs & detours for .NET

    Posted on November 11th, 2009 Thibaut 1 comment


    Peli De Halleux, a belgian guy now working at Microsoft Research (Redmond) came back in Belgium at the Visug to talk about the project he’s working on. Stubs, Moles and Pex form together a lightweight framework to test .NET applications.


    Stubs is a stubbing framework solely based on delegates. Various examples can be found here.


    Here’s an example of what you can accomplish with Moles, allowing you to replace any .NET method :


    And here, a diagram showing at a high-level view how Pex works :


    Pex is an automated whitebox testing tool for .NET. From your code and parameterized unit tests, test code is automatically generated in C# and test results can be seen in the “input/output table”.

    Project-related resources

    I could copy-paste the great description of the project off the official website… But I instead recommend to those of you who are interested in this to take a look at the following resources, explaining you what Stubs, Moles and Pex are all about in the details.


    Have a nice reading ;)


  • Book review : The Zen of CSS Design

    Posted on November 1st, 2009 Thibaut 2 comments
    The Zen of CSS design Almost every Web Developer knows the famous CSS Zen Garden, a project created by Web Designer Dave Shea aimed to encourage the use of standards-compliant CSS for a better web. Raw HTML was available to Web Designers who had to create some CSS that can completely change the layout of the website, thus underlying the power of semantical XHTML and best use of CSS. This full-color book, released following the CSS Zen Garden project success, is divided into 7 chapters : View Source, Design, Layout, Imagery, Typography, Special Effects and Reconstruction. Each of these ones teaches you best practices to CSS development (including cross-browser concerns in the details) but also to good Web Design in general.


    • Awesome book, very instructive
    • A very interesting approach, based on the best submissions (Zen Garden project) to teach best practices and tricks of expert Web Designers
    • Cross-browser concerns are explained very well, into the details and an overview of the alternatives to cope with ‘em is given.
    • A very instructive course about Web Design (imagery, typography, layout, …)
    • All chapters based on real world projects and not on academical examples
    • The best and more complete book about Web Design I’ve read to date


    • Not really a con, but this book is “medium to advanced” level, so good understanding of CSS is required before starting. Basics of CSS aren’t covered as the book immediately digs into the details, exceptions and advanced use of CSS


    An instant-classic, awesome and very instructive book that every Web Designer must have on his/her bookshelf ! Finally note that you should have a good understanding of CSS prior to reading this book and have an interest in Web Design as some chapters such as “imagery” and “typography” are purely dedicated to this field.