that is the architectural question

来源:百度文库 编辑:神马文学网 时间:2024/04/30 05:17:57

To Layer or not to Layer? That is the Architectural Question
Posted by:Kevin Hooke on July 27, 2005 @ 11:48 AM
From "To Layer or not to Layer? That is the Architectural Question:" It‘s a commonly accepted practice when designing large scale enterprise applications (or even smaller applications for that matter) to layer your architecture code as well as your application code.
Separation of concerns - for example, separating your business logic from your data access logic, or your presentation logic from your business logic - is a common technique for ensuring that your application code is well defined in terms of it‘s responsibilities. This approach gives you code that is easier to maintain and easier to debug - if you have a problem with the data access then you know to look in code in your data access layer.
In Java-based applications, this capability is often taken too far. Mr. Hooke describes writing an application in PHP, where business logic is expected to be put in the presentation layer, and describes it as such: "From being in the frame of mind where I am encouraged to ‘separate, separate‘, ‘build more layers!‘, this is a refreshing change - I can develop pages in a fraction of the time than it would take me with a typical J2EE layered approach! Why? Because I don‘t have to develop additional plumbing code to interact between my many layers."
_xyz