Home  /  Questions  /  Question



55   94.7
Jun 27, 2011


Please name the following Design Pattern...

Hi All,

Can someone let me know which Design Pattern are we using?. Our application has Presentation Layer, Business layer and Data layer.  The data is exchanged between these three layers using corresponding objects. We have developed a separate class library which holds only the "Properties", i.e. DTOs (Data Transfer Objects with just get and set accessors). The business layer and data layer has manager class to perform operation on data.

Sample code below:

Presentation Layer

btnSave_Click(sender, object)
{
   // Class from the class library which has only properties
   UserInfo userInfo = new UserInfo();  
   userInfo.FirstName = txtFirstName.Text;
   userInfo.LastName = txtLastName.Text;

   // Object of business layer
   UserManager userMngr = new UserManager();
   userMngr.Save(userInfo);
}

Business  Layer

UserManager class

public bool Save(UserInfo userInfo)
{
    // Performs business logic here if any
    // Data access layer object
    UserDataManager dataMngr = new UserDataManager();
    return dataMngr.Save(userInfo);
}

Data Layer

UserDataManager class

public bool Save(UserInfo userInfo)
{
    // Inserts the data to DB
}

DataObjectsLibrary (the library where UserInfo class exist)

UserInfo class

public class UserInfo
{
    public string FirstName { get;set;}
    public string LastName { get;set;}
}

====

I am looking for a pattern name for this.


Thanks




60   95.3
Jul 05, 2011
This is not following a specified pattern, you can say layered architecture. There is a scope of introduction to Abstract Factory / Factory patterns for Managers creations.
 1 comment
 
Thanks dude --- Anish Anick  Jul 10, 2011