we are planning to upgrade our web site and use the N-TIER design. i have read this article which is quite good in my opinion.
My questions are: 1) is this architecture still valid for designing an application ? 2) should we use other architecture like the onion , 3 layer , ddd and so on? 3) in the Service Layers the article suggest that we divide th开发者_如何转开发e data messages and the commands, is the best implementation is to create two services one for data and one for commands ? ThanksThe architecture depends on what kind of project you need to create, complexity of project and business logic, scalability, maintainability, any way you should implement your project in the way that you can easily change your code and the tiers and classes should be much more decoupled you should use ASP.NET MVC for application layer, and I suggest to use IoC-contaners for dependency injection, you can start with 3 layer architecture with Repositories data access layer, Services classes business logic layer, ASP.NET MVC application layer and another thing you should use ORM like Nhibernate or Entity Framework If you have a complex domain you should look at the DDD
- Yes this article is still a good article
- This really depends on your technical and functional requirements. You can not start with an architecture and assume the implementation will fit any application.
- see 2
It really depends on the applications requirements.
I tend to prefer the 4 tier design in that i have:
- Data access
- Entities
- Facades
- UI
However i have worked with developers who prefer to use pure business objects. That is the objects themselves arent truely representations of the records in the data store and they themselves contain all functionality necessary to perform the actions they need to perform. This includes data access. One example of this is approach is CSLA.NET.
I do feel this discussion is a bottomless pit of opinions based on upon experience though :)
精彩评论