0

I am new to Java EE architecture (trying to do some reading on this - please suggest good sources).

When we use MVC pattern, the DAO layer consists of classes that contain methods to access the database. Similarly service layer contains classes that make use of methods from DAO classes and have some business logic. I see in some projects that Util classes are used and they contain methods that perform some work for the service layer classes.

What is the exact purpose of this Utility layer? Can it contain getters and setters from Spring dependency injection?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
user811433
  • 3,999
  • 13
  • 53
  • 76

1 Answers1

1

There is no "utility layer". Constructions like like MyMagnificentMailer are just a different kind of service. I am not sure if you actually separate the domain objects from DAOs (or other forms of abstraction for storage ), but just like domain object can contain and interact with other domain object, same way your Authentication service can interact with Mailer and vice versa.

There is not rule saying, that real services have to be build on top DAOs.

tereško
  • 58,060
  • 25
  • 98
  • 150