Hi
I am sure all of this has been dealt with before, but anyway ...
I am about to embark on a new software development project. It is in ASP.NET and C#, and using a SQL Server database. I am intending to use layers in the application:
(1) Presentation layer - Responsible for displaying information to the user, and for handling user input
(2) Business layer - Responsible for implementing business rules
(3) Data Access layer - Responsible for all data storage, retrieval, update etc.
I intend that no layer should have any knowledge of the inner workings of any other, and all interaction should be via well defined interfaces. I feel that this will aid testing and maintenance of the system. I intend to use NUnit to enable Test Driven Development.
I will also use the simplest workable design for my objects, and refactor should the complexity increase and I find that code is getting duplicated, or if things are getting too difficult to understand.
I have read somewhere that one shouldn't use concrete classes between interfaces when using layers like this, and should instead use an Interface (I know, using the same term for different things gets confusing!), and something like an Abstract Factory to pass back implementations of the interface.
However, in many cases I feel that this may add too much complexity to a system, and can be overkill. I can see the benefits to it in other cases though.
Does anybody have any comments on my proposed approach, and also on interfaces between layers?
I am very keen to use good OO practises in my development.
I am sure all of this has been dealt with before, but anyway ...
I am about to embark on a new software development project. It is in ASP.NET and C#, and using a SQL Server database. I am intending to use layers in the application:
(1) Presentation layer - Responsible for displaying information to the user, and for handling user input
(2) Business layer - Responsible for implementing business rules
(3) Data Access layer - Responsible for all data storage, retrieval, update etc.
I intend that no layer should have any knowledge of the inner workings of any other, and all interaction should be via well defined interfaces. I feel that this will aid testing and maintenance of the system. I intend to use NUnit to enable Test Driven Development.
I will also use the simplest workable design for my objects, and refactor should the complexity increase and I find that code is getting duplicated, or if things are getting too difficult to understand.
I have read somewhere that one shouldn't use concrete classes between interfaces when using layers like this, and should instead use an Interface (I know, using the same term for different things gets confusing!), and something like an Abstract Factory to pass back implementations of the interface.
However, in many cases I feel that this may add too much complexity to a system, and can be overkill. I can see the benefits to it in other cases though.
Does anybody have any comments on my proposed approach, and also on interfaces between layers?
I am very keen to use good OO practises in my development.