7

I need to get a start as to where I put those technologies in the 3 Tier architecture: This is what I have...

  • presentation layer: HTML, JSP

  • app. layer: Java EE, Spring

  • data access layer: Hibernate, PostgreSQL database

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
tzippy
  • 6,458
  • 30
  • 82
  • 151
  • The question is if this could be cosidered correct. Or would you, for instance, put hibernate in the application layer? – tzippy Aug 08 '10 at 11:38

3 Answers3

30

You are mixing Tier and Layer which makes things pretty confusing, especially for yourself! If your question is about layers, then ask a question about layers.

Anyway, let me try to clarify...

In a Three Tier architecture, the Tiers consist of:

  • the Client Tier (or Presentation Tier),
  • the Business Tier (or Middle Tier or Logic Tier or Application Tier, etc),
  • the Enterprise Information Systems (EIS) Tier (or Data Tier).

And here are the typical layers of a multi layered application:

  • the Presentation Layer: Servlet/JSP
  • the Service Layer: Spring Services + Spring Transactions or EJB Session Beans
  • the Domain Layer: POJOs
  • the Data Access Layer: Hibernate/JPA
  • the Physical Layer: Database, LDAP, file system, etc.

Hibernate would be part of the Data Access Layer (but PostgreSQL is part of the Physical Layer).

The Presentation, Service, Domain, Data Access Layers map to the Business Tier. The Physical Layer maps to the Data Tier.

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
  • 1
    Nice explanation. One thing makes me confused though - is the presentation layer not part of the presentation tier? Edit: Oh, I think I understand. The presentation tier holds things like web browsers, web service clients etc. – Roger Apr 04 '13 at 13:19
1

Yes, I would put Hibernate in the data access layer. In fact the 3rd layer is the "Data layer" and not the data access layer, maybe this confuses you. So everything that's business logic related goes into the app (or business) layer.

thelost
  • 6,638
  • 4
  • 28
  • 44
1

If you want to use Spring MVC, it will most likely live in the presentation tier.

earldouglas
  • 13,265
  • 5
  • 41
  • 50