Archive for the Design Pattern Category

The Component Diagram can show various classes, interfaces, pages, executables etc. packaged into deployable units called components. Components expose interfaces which are either the provider interface or the paired consumer interface. Component can have internal other multiple components which represent any deployable unit like web site, class library, page etc. and the container component can delegate the interface implementation to these internal components. In the following example the ITester interface of the Development component is consuming the ITester interface of the Testing component. Testing component has Tests and Unit Tests as further internal components. Tests component implements the ITester interface so the Testing component delegates tasks of ITester interface to Tests component. Similarly Unit Tests component implements IUnitTest interface so the Tests component further delegates the tasks of IUnitTest to Unit Tests component.
ComponentDiagram
(more…)

Till VSTS 2008 there was no support for various architectural diagrams which form the UML. Team Edition for Software Architects supported some non-UML but very practical diagrams. Those diagrams provided us ability to do High Level Design of solution architecture and infrastructure architecture. Except in case of WebService the Application Diagram did not support the Low Level Design and on the infrastructure side, except for deployment diagram no other design elements were supported. Team System 2010 for Architects has quite a number of enhanced capabilities compared to Team Edition of Software Architects 2008. Distributed Diagrams model which was present in the Team Edition for Software Architects 2008 is no longer available with Team System 2010 for Architects.
First two phases of traditional Microsoft Solution Framework (MSF) are Envisioning and Planning. Although some of the architectural diagrams are started to be created in envisioning, the completion of those happen during the planning phase. Planning phase is further divided in three processes which run to an extent parallel but are started with a little bit of phase difference. Those processes are:

· Conceptual Design
· Logical Design
· Physical Design

In this article we will look at the details of various diagrams which are required during each of the design process and check if it is supported by Team System 2010 for Architects. Architectural diagrams can be created using Team System 2010 for Architect in which there is a project template for ‘Modeling Project’ which allows us to create various diagrams. We will take an overview of those in the article.
Conceptual Design: This is a process in which from a hazy cloud of needs, crystallization of requirements happens. Requirements are gathered, analyzed and prioritized. Requirements are modeled using ‘Requirement Document’ and ‘Use Case’ diagrams. We also document the processes that are followed by the business. These processes are workflows within the business system. We can use ‘Activity Diagram’ to model those processes and workflows. During the conceptual design the architect will also list all the user roles that will be interacting with the system and the general architecture of the system. General architecture definition will contain the list of logical layers and physical tiers which will be present in the future state of the system. To model it, we can use the ‘Layer diagram’ which is available in the Team System 2010 for Architects.
usecaseTools
(more…)

Hi Dudes,

The Factory design pattern is another heavily-used pattern in ASP.NET applications
to help introduce loose coupling and remove dependencies in the code. The Factory
method is a creational design pattern that is used to create objects without any prior
knowledge of the type of the object. We delegate the responsibilities of creating the
actual objects to subclasses or separate factory classes. This can be accomplished by
using interfaces or abstract classes.

FactoryMethod

(more…)

Hi guys,

If we know better about the design pattern, it will be usefull a lot for us to build the reusable software component like we want to achieve it, one of the famous pattern is singeleton and much of developer especially in web development until this time still confuse to implemented. Now i wanna to discuss the common usage of singeleton pattern in aspnet which always shown in development project. Lets rock and roll …

There may be numerous programming scenarios when we may need to restrict an
object to a single instance. Some of them are:

  • A single instance of a mail server might be required to process all incoming
    mail requests.
  • The Session object in ASP.NET is implemented using singleton pattern. That
    is why each user will have only one session instance accessible at any point
    of time.
  • The Application object in ASP.NET is also singleton based. There is only
    one instance of the Application object for an entire application.
    We may need a single instance of a logging utility to process all logging
    requests in our application.

(more…)

Hi Developer geeks,

See me again in this session, i would like to share to you about somekind practically method of my experience and expertise during my professional development experiences. Due to many colleagues of mine that was asking me to write down the methodology of software development with the real implementation as a practise , therefore i would like to digest some surrogate keys of enterprise development, first of all that the IT worlds has so huge environment perspectives including the software development that’s why i supposed to aim about the limitation of mine that probably missing the pieces of a factor that i couldn’t  mentioned it in this blogs, but for at least it can contributed some lights that could become a bright way about the Enterprise application development. I devide into some section or session about enterprise development architecturing. in this session i’d like to talk about the initial of development process or in the other word is Pre Development Analysis process. There are many tools that coud drive the collaboration process of team to design the enterprise software, VSTS (Visual Studio Team System) + TFS (Team Foundation Server) are the one of the tools that probably become the best in the market for accomodate this whole of iteration process of enteprise software development, the main reason are this tools could accomodate the skeleton of defining the whole process methodology / ALM / SDLC as an enterprise collaboration team development such as MSF (Microsoft Solution Framework) Agile Methodology, MSF CMII methodology and also SCRUM methodology. Those MSF methodology will drive the all role activies that involved in software development based on their activities and roles which has a final path to QOS (Quality of Service) develoment so it could guarantee the control of the role activies and also the together moving of each role activies into one standard purpose. Okay let’s take a look about the first section picture about how to describe the Pre development analysis of based role activity and functionalities

Pre design

i will write down each of those details description on that picture above, as you could see above that actually we could devide the pre analysis iteration process into two main section Application requirement design and project timeline and resources, the application requirement design is a zone of technically side of pre development analysis and the project timeline and resources is the grey area and become a bridge of technical world and business world. in teachnicall world zone there are 5 roles involved (SA,BA,Network Engineer,DBA and Developer)  whether coordinate by software architect role and the other zone was hold by the person who could drive the all process into the goal that become the final path of achievement, but i guess from those view point we will have some figures about the pre design of software enterprise development architecture.

see you in my next session,

 cheers,

Doddy Ch Saputra, MCPD,MCITP,MCTS

Folks,

Session object in Web Application is very important things for transferring variable or even doing some caching, as we known before in ASPNET there are a view mechanism to implement this caching object, one way approach is using the SQL server session wheter this way is eat the peformance of the retrieving the session object coz the system need to go round trips during the process, okay let’s forget it about using SQL Server session object in stead of we implement the session that we stored in Dictionary Collection which encapsulated in the class, the second things is using the cache object whether the system could save the system in web server memory by implement the cache and put it the span time to arrange the life cycle of the caching. Those action should be done coz the cache has a unlimited time life cycle in the web server memory, until  we destroy the cache by manually.

(more…)

image005.gif  OVERVIEW

Model –View-Presenter ( MVP ) Pattern is one of the popular design pattern for creating the enterprise application, introduced by Martin Fowler, this pattern leverage many functionalities of loose coupling modules.

The Intention is separation between its business logic to user interface design, and for the developer will just keen to think to the particular business logic to drive the application, the MVP Pattern also enhance the fully functionality of module testing, which mean you could use mock object to test your every module and class or every single wire in your MVP application.

There are many kind implementation of MVP Pattern, one of the best and become the easiest way to implement the MVP Pattern is using the MVP framework from the Microsoft Pattern and Practise team. In this case I’ll try to explain of using the MVP Bundle package from them which is become the embedded skeleton as a library tools in your visual studio.

image0061.gif  Analysis Surgery

Actually there are two variants functionality and also the benefit that we could get from this bundle, which are Passive View and Supervising Controller.

Problem

A page in a Web application contains controls to display application domain data. A user can modify the data and submit the changes. The page retrieves the domain data, handles user events, alters other controls on the page in response to the events, and submits the changed domain data. Writing this code in the Web page (the code-behind class) makes the class complex, difficult to maintain, and hard to test. In addition, it is difficult to share code between Web pages that require the same behavior.

Forces

You want to maximize the code that can be tested with automation. (Views are hard to test.) You want the share code between pages that require the same behavior. You want to separate business logic from UI logic to make it easier to understand and maintain.

Solution

Separate the responsibilities for the visual display and the event handling behavior into different classes, the view and the presenter. The view class (the Web page) manages the controls on the page, and it forwards events to a presenter class. The presenter contains the logic to respond to the events, update the model (business logic and data of the application) and, in turn, manipulate the state of the view.

To facilitate testing the presenter, make the presenter have a reference to the view interface instead of to the view concrete implementation. By doing this, you can easily replace the real view with a mock implementation to run tests.

View Updates

When the model is updated, the view has to be updated to reflect the changes. View updates can be handled in several ways. The Model-View-Presenter variants Passive View and Supervising Controller specify different approaches to implement view updates.

In Passive View, the presenter updates the view to reflect changes in the model. The interaction with the model is handled exclusively by the presenter; the view is not aware of changes in the model.

In Supervising Controller, the view interacts directly with the model to perform simple data-binding that can be defined declaratively, without presenter intervention. The presenter updates the model; it manipulates the state of the view only in cases where complex UI logic that cannot be specified declaratively is required. Examples of complex UI logic might include changing the color of a control or dynamically hiding/showing controls. Figure 1 illustrates the logical view of the Passive View and Supervising Controller variants.

mvp-1.JPG

Figure 1

Passive View

In figure 1, explain about interaction by model is handled exclusively by the presenter and then the view is updated exclusively by the presenter which using the view interface.

The decision to use Passive View or Supervising Controller lies primarily on the testability level that you want to achieve for your application. If testability is a primary concern in your application, Passive View might be more suitable because you can test all the UI logic by testing the presenter. On the other hand,

mvp-2.JPG

Figure 2

Supervising Controller

if you prefer code simplicity over full testability, Supervising Controller might be a better option because you do not have to write code in the presenter to update the view for simple changes ( as you can see at the figure 2 above ). When choosing between Passive View and Supervising Controller, consider the following:

  • Both variants allow you to increase the testability of your presentation logic.
  • Passive View usually provides a larger testing surface than Supervising Controller because all the view update logic is placed in the presenter.
  • Supervising Controller typically requires less code than Passive View because the presenter does not collaborate in simple view updates.

Note:

In the View-Presenter pattern, the presenter exclusively handles the interaction with the model and updates the view; the view is not directly bound to the model. Thus, this approach is in line with the Passive View variant described in this topic.

Interaction with the Model

You can implement the interaction with the model in several ways. For example, you can implement the Observer pattern and have the presenter listen to events of the model and update the view as required. Another approach is to use an application controller to update the model.

Liabilities

There are more solution elements to manage.
You need a way to create and connect views and presenters.
The model is not aware of the presenter. Therefore, if the model is changed by any component other than the presenter, the presenter must be notified. Typically, notification is implemented with events.

Hallo folks…see my again in my sharing knowledge moment in my development journal blogs,
i would like to share to all of you about the knowledge of creating the domain architecture,
in this case i would like to create the WCF ( Windows Communication Foundation ) especially for further purpose is
implement the SOA ( Software Oriented Architecture ).

I will separate the part of the knowledge become the trilogy knowledge which are :

  • Introduction the Domain WCF or Web service
  • Introduction the Service Factory from The Pattern and Practise team to implement the WCF or Web service as a Domain Artifact model.
  • sample implementation the WCF or Web service.

so..let’s try to rock’n roll …

(more…)

Hi..see you again.. this section is the continue part of my trilogy Multipurpose of Exception Handling class, okay let’s make it this quickly, the last class that we need is EmailGenerator class :

  • This class using 3 core of .Net library; System IO for accessing the XML email template,System XML and then System.Web.Email.
  • The main idea for this class is service another class that want to generate the email notification so we need to produce the public method for sending the emai, here are the method

public void AutomaticSendEmailLogging(string ErrorMessage)
        {
          
            MailMessage mailMsg = new MailMessage(); // Create instance of EmailMessage Object

            string templateName = FrameworkLayer.ConfigurationUtility.WebApplicationConfiguration.ProgrammerEmailName;
            mailMsg.From = FrameworkLayer.ConfigurationUtility.WebApplicationConfiguration.EmailSender;
            mailMsg.To = FrameworkLayer.ConfigurationUtility.WebApplicationConfiguration.ProgrammerEmail;
            //mailMsg.Cc = EmailUser;

(more…)