I have four project apart from Presentation layer
- Business Logic Layer
- Interface layer
- Object Model
- Data Access Layer
I have query in Interface layer. In a particular interface, the number of function declaration need implementation in Data access layer. Here I have two confusions
-
It seems one to one reletionship only(i.e one interface function per Data access layer class function).
-
Is the interface layer really required?
-
Can I remove teh Interface layer or any optimization required here ?
Take a look at the first blog post in the series I started recently. It covers just this (n-tier architecture), a similar person on SO asked a very similar question thus inspiring the blog series.
The post above (it includes sample code too) shows you how to do this without interfaces, but interfaces make things much more flexible and manageable in the future. So to answer your questions:
1 & 2. Interfaces are not required. You can use 2-tier architecture.
3. If you choose 2-tier, then yes, otherwise if you are going for a 3-tier solution then interfaces are pretty much a must.
The SO post that inspired it:
Implement a Save method for my object
Note that my SO answer for that post was never updated because I helped the gentlemen over Skype and made a specialized solution example for him.