mikeg22 wrote:
Otis wrote:
Mohammad wrote:
Question frans
how you identfy service layer operations?
by the needs of the service layer client which come from use cases?
so if you want to add new use cases then you must to modify service layer
or there are more generic approach?
I think it's a matter of how you define your tier's interfaces. Like what's discussed in the Concepts - n-tier development section in the docs. So it shouldn't matter if all tiers are on one box or on separate boxes. With that in mind I think it's straight forward to define what interface a tier has to expose and thus how your system is designed. But as it's a way of thinking, there is no real 'good' vs. 'bad': for one system there can be several different ways to design the different tiers.
I believe the quesioned being asked is if there is a way to do the facade in a generic way so that new use cases don't necessarily require a change to the session (facade?) layer.
That depends if the new use case requires functionality which isn't provided by the service layer. If the new use case requires data which isn't provided or functionality which isn't provided, the service tier has to be adjusted.
So you should design them also as individual systems. The service tier should provide a solid service for consuming clients, not only what one client needs. It's the same with n-tier development: you don't design the BL tier as a 1:1 copy of the gui tier. You design the BL tier the way it makes sense the most for the BL tier. Then in the gui tier you call the methods exposed by the BL tier to make the GUI tier work, which thus makes the BL tier decoupled in a way from the GUI tier, which is the same for a service.
Though it's a tough job, there is no fixed rulebook for this, as I said. It's a way of thinking, not a 10-step plan to get to the pot of gold. Designing a service is hard, you easily leave out important methods and at the same time it's easy to overdo the design also, with methods which are perhaps never called.