I have a question that I have never been able to solve:
Considering these two architecture
1st
UI layer
|
Application layer
|
Domain Layer
|
Infrastructure Layer
2nd
Client Tiers
|
Presentation Tiers
|
Business Tiers
|
Integration Tiers
|
Resources Tiers
What are the difference between them.
Where do entity beans lie in these architecture. If I have a business layer with object that implements business logic, why would I have to add behavior in entity beans. I read somewhere that it is an anti pattern to have domain model objects without behavior.
Thanks
Update
This is actually a project(training) that I need to do to get my msc in distributed systems.
These are actually the technologies I'm using
Struts 2 JPA HSQLDB
So if I understand well
My application consist of
A client layer (web browser) A presentation Layer (struts 2 ) A business Layer (POJOs + JPA) An integration layer (with hibernate DAOs) A resource layer (HSQLDB)
But as the presentation, business and integration layer are implemented on the same server (tomact) I only have a three tiers architecture. Am I right ?
As far as including behavior in my JPA objects, usually this is what I used to do : Have a dao for each JPA entity. Have a bean (like an EJB) that would manage the business logic required. So I never put beahvior on JPA objects.
Say for example I wanted to make a purchase request. I would have a CatalogueManager that would help me interact with items, suppliers. I would have also an EmployeeManager that would help me interact with employees. And finally a PurchaseRequestManager that would use the two previous business objects to make a PurchaseRequest.
Now what you are telling me is to put the methods that I have in the PurchaseManager in the PurchaseRequest JPA entity, and do the same for methods in EmployeeManager => to put them in the Employee JPA entity.
But what would happen if my employee object would also be used for the human ressources department, I would also need to put other methods there. For a big application I would have a lot of methods in the employee JPA entity. Wouldn't that be counter productive?
thanks