0

There are three types of classes:

  • Handler
  • Service
  • DAO

A handler handles an incoming command an calls a services. The services does caching and calls other services or a DAO. Services and DAOs are singletons.

Is there a way to create a custom warning if a DAO is used in one of the handlers?

1

1 Answer 1

1

You could try playing with some custom checkstyle rules but... you should rather try to it properly ;)

Create 3 modules (projects in Eclipse). Let Handlers know only about the Services (add a proper dependency to Handlers project) and let Serices know about DAOs (add a DAO project to Services dependencies). This way you will never make a mistake :]

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.