View Blog

The Great Library - Part 2 - Requirements and Architecture

Aug17

Written by:
8/17/2011 10:17 PM RssIcon

Requirements for the Great Library

Carrying on from Part 1, we work with the VenusPro to dish out a few more general requirements:

  • Users will be able to access the application through a web browser.  Targeting mobile devices is for future consideration.
  • VenusPro has a SQL Server 2008 R2 environment currently in place.  Therefore, this application must utilize SQL Server 2008 R2.
  • There are no current plans on making the application multilingual. 
  • They would like to make use of a mapping system (Google Maps, Bing Maps, etc.).
We also decide on the following:
  • The application will be referred to as The Great Library
  • Access Centres, and Goods, are to be used in the ubiquitous language.

And finally, some considerations:

    Aspects of the system will be utilized by another system they are working on (A Demand and Distribution Tracking System).  Metrics gathered from The Great Library will be used by this, which will impact costs.  Therefore, they want extra effort in testing the system.

  • For the sake of this project, we’ll assume the customer signs off for a couple of iterations worth of work. 
  • There isn’t nearly enough information to build a complete product at this moment.  In fact, we barely have enough to start.  But, we do have a lot of work that can be completed before we meet the customer again. 

    So let’s get started!

    Getting Started

    1. In Visual Studio click File -> New -> Project or use the shortcut Ctrl + Shift + N.
    2. In the left pane (Installed Templates), choose Other Project Types -> Visual Studio Solutions -> Blank Solution.  (Figure 1)
    3. Type “The Great Library” in the name field.
    4. Select an appropriate location.
    5. (optional) Choose Add to source control.  I can’t stress how important it is to use source control.  In our case we are using Team Foundation Server from Codeplex.  There are many other alternatives and you should be using one.  (Figure 2).
    6. (optional) Check-in the solution into Source Control.




      Architecture


      As tempting as it is to start coding, we shouldn’t.  It is in our best interest to think about the architecture.  For this, we’ll create a Modeling project and add it to the solution.  Unfortunately, this project type is only available in the Ultimate version of Visual Studio 2010.  If you don’t have it, grab a napkin and a pen (or equivalent).
      1. In Visual Studio click Architecture -> New Diagram or use short-cut Ctrl + \, Ctrl + N
      2. Choose Layer Diagram (Figure 3).
      3. Change the name to “GreatLibrary.layerdiagram”.
      4. Let it create a new modelling project.
      5. In the toolbox drag a Layer onto the designer.
      6. In the properties change the following:
      7. Name:  USERS
      8. Color:  Click the dropdown and choose something to your fancy.
      9. Repeat #5 and #6.  However, this time, change the Name to “PRESENTATION LAYER”
      10. Right Click USERS.  Choose Add -> Bidirectional Dependency.  Drag the dependency down to the PRESENTATION LAYER.
      11. Repeat until the diagram matches Figure 4.  Note:  You can drag Layers inside of Layers (e.g. Web UI and Mobile UI inside the Presentation Layer).
      12. Check-in solution.


      Much like what we know about our system, the layer diagram is barren.  We only know:

      1. That there are some users
      2. That the users will access the Great Library through a Web UI (and later maybe a Mobile UI)
      3. That there is another system that is interested in this solution.
      4. That our major data source is in SQL Server 2008 R2.
      5. We have 3 major domain entities: Access Centres, Goods, Users (TBD).
      6. A service layer is our best option when we have multiple consumers of the Business Layer.  This allows for single entry point into the system.
      7. Somehow, we need to get data out of the database.  Hence, a Data Access Layer is needed.

      We haven’t addressed any details of the system, such as, what technology to use as a UI.  Nor have we even identified what our cross-cutting concerns are, just that there are probably some.  Finally, we haven’t drawn the mapping system into the diagram.

      Solution Organization

      Since we have now organized the Great Library on paper, it is a good idea to organize it in the actual solution.  Enterprise development usually has a high number of projects.  Having a good flow results in an easier understanding of the system and less time needed decided where to place code.  In my experience, projects with a poor organizational setup have had adverse side effects that impact development.

      • 1.       In Solution Explorer, right the Solution -> Add -> New Solution Folder.  Type in 01. Presentation Layer
      • 2.       Repeat #1 for:
      • a.      02.  Service Layer
      • b.      03.  Business Layer
      • c.      04.  Data Access Layer
      • d.      05.  Data Layer
      • e.      Framework
      • f.       Solution Items
      • g.      Tests
      • 3.       Drag and Drop GreatLibrary.Model into Solution Items.
      • 4.       Your solution should now look like Figure 5.
      • 5.       Check-in to source control.

      Next Post

      That brings our solution up to Change Set 8079.  In Part 3, we will take a stab at the heart of the system:  The Business Layer.


    Your name:
    Gravatar Preview
    Your email:
    (Optional) Email used only to show Gravatar.
    Your website:
    Title:
    Comment:
    Security Code
    CAPTCHA image
    Enter the code shown above in the box below
    Add Comment  Cancel