Wiki
This website is a wiki. If you like and use our processes, techniques and tools, please add your experience and best practices. Just register and share.


Contents


User


Smart


Community

















Introduction

Goal

This guide shows you an end-to-end approach for implementing ADF Framework for a web application. Whether you are new to ADP development, or looking for ways to improve your current development approach, you will find insights that you can tailor for your specific scenarios.

Audience

This document is intended for developers who want to get familiar with building an ASP.Net web application with the Accelerated Delivery Framework, Smart use cases and code generation.
The guidance itself requires basic knowledge of the .Net framework and C#. The targeted reader is an implementer starting on his first project on the ADP Assembly Line.

Approach

It is a step by step walkthrough to build a web application, covering initial sketches and thoughts to ADP development. Here we are showing how developers can identify their smart use cases and instantly get a working solution against it.

Result

At the end of this quick start an ASP.Net web application is started with the use of the Accelerated delivery Framework, Smart use cases and code generation. This means that systems will be organized according to standard software architecture, be efficient and ultimately be delivered faster and with a higher degree of quality.
Use cases have quickly become a widespread practice for capturing functional requirements. This is especially true in the object-oriented community where they originated, but their applicability is not limited to object-oriented systems. Here you will see the power of UML relationships (generalization, include and extends) that can be used to structure use cases.

Tools Required

Tobago MDA Generator

A code generating tool for fast development. This is facilitated using model driven architecture (MDA).

INPUT: UML models

OUTPUT: Forms, Estimation spread sheets, User interface specifications in Word, Classes, Web Services or SQL etc.


Downloads
  • Tobago MDA. Download our free code generation tool.
===Enterprise Architect===
Advanced modeling software for UML from Sparx Systems.
A trial version can be downloaded from http://www.sparxsystems.com/

INPUT: Domain model diagram, Classes, Use Cases etc

OUTPUT: UML models
===Visual Studio===
Microsoft’s .NET development studio. The components Visual C# and Visual Web Developer should be installed.

INPUT: Forms, Classes, Interfaces etc

OUTPUT: Web application and other products
===MS SQL Server===
Microsoft’s SQL Server management studio.

INPUT: SQL Scripts

OUTPUT: Data Storage
===BaseProject===
The starter solution of an ADP web-project.

INPUT: Skeleton to create a new project

OUTPUT: A ready for run application
===ADF Framework===
The Accelerated Delivery Framework (ADF) captures the most important services necessary for fast software development. This framework employs many services, such as logging, database connectivity, error handling, business rule validation, use case navigation, binding and persistence, localization, etc. All services are plugged-in to our applications using dependency injection. It is a prerequisite of ADP projects.

Development Life Cycle

Set up directory structure

Purpose

Extract the different sources in the correct locations

Steps

  1. Create a new directory, for example My Documents\ADP Quickstart
  2. Extract ADF in a subdirectory ADF
  3. Extract Tobago Patterns in a subdirectory Tobago Patterns
  4. Create a subdirectory Projects, and extract BaseProject in Projects\BaseProject
    ====Result====
    The sources are now in their correct relative locations so they can refer to each other.
    ===Create Model===
    ====Purpose====
    Use Enterprise Architect to create an UML model for managing users.
    ====Steps====
  5. Open BaseProject.Model\BaseProject.EAP in Enterprise Architect.
  6. Right-click on Project.Business > Add > Add Diagram
  7. Select UML Structural from left and then select Class from right. Press 'Ok'. See the picture below:
    Image
  8. Drag Class from toolbox and add to Diagram.
  9. Set Name = User, Stereotype = Business class, Scope = Public, Language = C# as shown below:
    Image
  10. Select Details tab and click on Attributes. See the picture below:
    Image
  11. Add some attributes (Name, Email). At the time of adding attribute set Name, Type and Scope = Public. Click 'Save'. After addition of attributes click 'Close'. Follow the picture below:
    Image
  12. Open Project.UseCases > Right-click on <<process>> Actors > Add > Add Element.
  13. Set Name = Administrator and click 'Ok'. See the picture below:
    Image
  14. Right-click Project.UseCases > Add > Add Package. Set Name = 'Manage User'. See the picture below:
    Image
  15. Select UML Behavioral from left, UseCase from right and click 'Ok'. See the picture below:
    Image
  16. Double click on Manage User usecase from Project Browser.
  17. Drag UseCase from toolbox and add to Manage User usecase. Set Name = Manage User, Stereotype = manage, Scope = Public and click 'Ok'. See the picture below:
    Image
  18. Drag another usecase onto Manage User usecase. Set Name = Select User, Stereotype = select, Scope = Public and click 'Ok'.
  19. Add Application Boundary around them (i.e. Manage User and Select User) from toolbox. See the picture below:
    Image
  20. Drag Administrator from <<process>> Actors and add As Simple Link into Manage User usecase, click 'Ok'. See the picture below:
    Image
  21. Drag association from Administrator to Manage User. See picture below:
    Image
  22. Drag include from Manage User to Select User. See picture below:
    Image
  23. Right-click on Manage User, click Attributes. Set Name = User, type = User, Scope = Public, Stereotype = manage, 'Save' the attribute and 'Close'. See the picture below:
    Image
  24. Right-click on Select User, click Attributes. Set Name = User, type = User, Scope = Public, Stereotype = select, 'Save' the attribute and 'Close'.
  25. Save all diagrams.
    ====Result====
    An UML model
    ===Export the UML Model===
    ====Purpose====
    Export the UML model in a format readable by Tobago MDA Generator.
    ====Steps====
  26. In the project browser, Right-click on Project > Export Model to XMI.
  27. Uncheck everything under General Options
  28. As Filename, select BaseProject.Model\BaseProject.xml
  29. Click on 'Export' then 'Close'. See the picture below:
    Image
    ====Result====
    A XML representation of the model
    ===Generate Code===
    ====Purpose====
    Use Tobago MDA Generator to generate code, pages, documents, etc.
    ====Steps====
  30. Start Tobago MDA Generator
  31. Open Project BaseProject.Model\BaseProject.tpf
  32. Set Pattern Path to the location of Tobago Patterns
  33. Set XMI File to BaseProject.Model\BaseProject.xml. See the picture below:
    Image
  34. Click on 'Import XMI'
  35. Generate code as shown in table below:
    Image
    ====Result====
    All files needed to build BaseProject are now in their appropriate folders.

Build ADF

Purpose

Generate the dll’s of the assemblies in ADF.sln

Steps

  1. Open ADF.sln
  2. Build the solution. The build target is Bin\Output, which is referenced by BaseProject

Result

The ADF dll’s have been built and are in a location where the BaseProject can find them.

Update Solution

Purpose

To include all generated files in the BaseProject.sln solution and ready to run application.
NOTE: In this document we are not using the FireStarter Tool. If you want to create a new solution for your requirement, then FireStarter replaces everything related to name “BaseProject” by specified <<ProjectName>>. For example - suppose user want to create a project name as “ColumbusTravel”. The tool will replace “BaseProject” to “ColumbusTravel”. The tool will take Project Name (Application name, what you want to create), Source (the path of BaseProject.zip) and Destination (path where you want to physically store the application) as input and give the final solution as output. Basically the BaseProject.sln acts as a template to create the new one. If you use FireStarter first create the final solution and follow the below stapes. For more information see Tobago Firestarter page

Steps

  1. Open BaseProject.sln
  2. Include all Tobago MDA generated files (shown above in Table 1) into the solution.

    Include Files into BaseProject.Web: Right click on BaseProject.Web in Solution Explorer -> Click on “Refresh Folder”.

    Include Files into BaseProject.Database: Right click on “Create Scripts” folder of BaseProject.Database -> Click on “Add Existing Item” -> A window will open. Select all SQL files from “BaseProject.Database\Create Scripts” folder of window -> Click on 'Add'.

    Include Files into BaseProject.Business, BaseProject.Data, BaseProject.Process and BaseProject.Web.Panels: Select the any of mentioned project in Solution Explorer -> Click on “Refresh” button of Solution Explorer -> Click on “Show All Files” button of Solution Explorer -> Select all excluded CS files from folders and project root (Other then folders bin, obj and file csproj) -> Right click on selected files and click on “Include In Project”.
  3. In BaseProject.Database\Create Scripts, run BaseProjectDatabase.sql on the master database.
  4. From the same location, run SmartReference.sql and User.sql on the newly created database
    NOTE for steps 3 and 4: If you unable to create the database by the above procedure then create the database from SQL Server Management Studio
  5. In BaseProject.Web\Web.config, check web.config connection strings. Change the “Data Source”, “Catalog” and “Integrated Security” as per your choice.

<add key="Application" value="Data Source=localhost;Initial Catalog=BaseProject;Integrated Security=SSPI"/>
<add key="SmartReference" value="Data Source=localhost;Initial Catalog=BaseProject;Integrated Security=SSPI"/>

  1. Open BaseProject.Web\MasterPage.master. Under the line that starts with <% Register, add:
    <%@ Register src="Controls/AdministratorMenu.ascx" tagname="AdministratorMenu" tagprefix="uc2" %>
  2. Add
    <uc2:AdministratorMenu runat="server" />
    within the
    <div id="sidebar">
  3. Run the Web application by pressing F5

In case you get an error

  • Compile Error – If you get the error like “The type or namespace name 'Adf' could not be found (are you missing a using directive or an assembly reference?)” then check the References of each project. Are the ADF assemblies referenced correctly?
  • Database Connection Error – Check the Data Source and authorization part of connection string in web.config if you get database error at runtime.
  • No template found! – This error will be generated if you forgot to add the attribute of Use Case or did not set the stereotype of the attributes. See the below pictures
    Image
    OR

    Image
    ====Result====
    A working ASP.NET web application.