basic object creationhttp://www.codeproject.com/Articles/335594/A-Basic-Introduction-of-Class-For-Beginners
http://stackoverflow.com/questions/6558335/what-is-use-of-parent-object-instantiating-with-child-class
http://www.codeproject.com/script/Content/SiteMap.aspx
http://prasadhonrao.com/web-forms-mvc-single-page-app-web-pages-comparison/
http://1stwebdesigner.com/preparing-web-design-project/
http://imar.spaanjaars.com/573/aspnet-n-layered-applications-introduction-
help reduce complexity and improve code reusability
It is often thought that this automatically creates a decoupled application. However, just creating layers doesn’t make your code loosely coupled.
https://www.kenneth-truyers.net/2013/05/12/the-n-layer-myth-and-basic-dependency-injection/
basic object creationhttp://www.codeproject.com/Articles/335594/A-Basic-Introduction-of-Class-For-Beginners
http://stackoverflow.com/questions/6558335/what-is-use-of-parent-object-instantiating-with-child-class
http://www.codeproject.com/script/Content/SiteMap.aspx
http://prasadhonrao.com/web-forms-mvc-single-page-app-web-pages-comparison/
http://1stwebdesigner.com/preparing-web-design-project/
http://imar.spaanjaars.com/573/aspnet-n-layered-applications-introduction-
help reduce complexity and improve code reusability
It is often thought that this automatically creates a decoupled application. However, just creating layers doesn’t make your code loosely coupled.
https://www.kenneth-truyers.net/2013/05/12/the-n-layer-myth-and-basic-dependency-injection/
Avoid Too Many Parameters
Declare a class instead of too many parameters.
Creating a class that puts all these parameters together. This is generally a better design and valuable abstraction.
Avoid Complex Expressions
Minimize the Number of Returns
Use Parameterize queries instead of inline query
public DataTable GetUser(string userid)
{
str = "select ,PINCODE,ACTIVE from mkt_user_mast where type=:userid";
OracleCommand orc = new OracleCommand(str);
orc.Parameters.AddWithValue("userid", userid.ToUpper());
dst = objconnection.fnselectPara(orc);
return dst;
}
Separation of concerns - by putting code in separate layers, you separate the various parts of your application, such as data access, business logic and the UI. This makes it easier to design and build the application and makes it possible for developers in multiple disciplines (database, server side programming, and frontend development, design) to work on the application in parallel.
Abstraction - With a layered architecture it's easier to look at a complete application and understand the roles and responsibilities of individual layers and the relationship between them. Each layer has its own responsibilities which allow you to analyze them in isolation.
Testability - with a layered architecture, it's much easier to test each layer separately with unit tests as there are fewer dependencies between the various layers. This means, for example, that you can test your business logic or your UI without requiring a real database to test against.
Replaceability - It'll be easier to swap out layers. For example, you can replace your data access technology without affecting the other layers higher up in the stack.
Reuse - You can reuse one or more layers in different applications. You'll see the benefits of this in part 6 through 9 where the same data access and business layers are reused in four different frontend applications without requiring any changes to the lower layers.
http://aspnetboilerplate.com/Pages/Documents/NLayer-Architecture
http://dotnetdaily.net/tutorials/n-tier-architecture-asp-net/
http://aspnetboilerplate.com/
class Person - Entity and POCO.
an instance of this class is Domain Object
class Person
{
public string PersonId;
public string Name;
public string Email;
public static bool IsValidName() { //logic here}
public static bool IsValidEmail() { //logic here }
}
class PersonService
{
private PersonRepository pRepository;
PersonService(PersonRepository pRepository)
{
this.pRepository = pRepository;
}
public bool IsExistingEmail(string email)
{
//calls repo method to see if email is in db
}
public Person GetPerson(email)
{
return pRepository.Get(email);
}
public void SavePerson(Person p)
{
if (Person.IsValidEmail(p.Email) && !IsExistingEmail(p.Email)
{
pRepository.Save(p);
}
}
}
class PersonRepository
{
public void Save(Person p)
{
//save to db
}
public Person Get(string email)
{
//get from db
}
public bool IsExistingEmail(string email)
{
//see if email in db
}
}
Abstraction - With a layered architecture it's easier to look at a complete application and understand the roles and responsibilities of individual layers and the relationship between them. Each layer has its own responsibilities which allow you to analyze them in isolation.
Testability - with a layered architecture, it's much easier to test each layer separately with unit tests as there are fewer dependencies between the various layers. This means, for example, that you can test your business logic or your UI without requiring a real database to test against.
Replaceability - It'll be easier to swap out layers. For example, you can replace your data access technology without affecting the other layers higher up in the stack.
Reuse - You can reuse one or more layers in different applications. You'll see the benefits of this in part 6 through 9 where the same data access and business layers are reused in four different frontend applications without requiring any changes to the lower layers.
http://aspnetboilerplate.com/Pages/Documents/NLayer-Architecture
http://dotnetdaily.net/tutorials/n-tier-architecture-asp-net/
http://aspnetboilerplate.com/
class Person - Entity and POCO.
an instance of this class is Domain Object
class Person
{
public string PersonId;
public string Name;
public string Email;
public static bool IsValidName() { //logic here}
public static bool IsValidEmail() { //logic here }
}
class PersonService
{
private PersonRepository pRepository;
PersonService(PersonRepository pRepository)
{
this.pRepository = pRepository;
}
public bool IsExistingEmail(string email)
{
//calls repo method to see if email is in db
}
public Person GetPerson(email)
{
return pRepository.Get(email);
}
public void SavePerson(Person p)
{
if (Person.IsValidEmail(p.Email) && !IsExistingEmail(p.Email)
{
pRepository.Save(p);
}
}
}
class PersonRepository
{
public void Save(Person p)
{
//save to db
}
public Person Get(string email)
{
//get from db
}
public bool IsExistingEmail(string email)
{
//see if email in db
}
}