Introduction
I am working on a Java EE Web Application that is a basic CRUD app. It is built with Servlet
and JSP
technologies, without any Frameworks. I am doing it to make my hands dirty in plain Java EE things.
Project structure
Here are directories/packages of the project:
entity - entity classes which are simple POJOs for my domain.
dao - Data Access Object stuff.
service - represents Service layer that performs some additional computations/actions on top of the DAO objects.
util - utility classes to hash password, validate entered data, etc.
controller - Front Controller Design Pattern implementation;
FrontController
class that provides a centralized entry point of all requests.- action - it has implementation of Strategy Design Pattern; it has
Action
interface,ActionFactory
with aMap<String, Action> actions
which is mapping URL to the concrete action, and it has Action implementations such asSignUpActionImpl
,DashboardActionImpl
, etc.
- action - it has implementation of Strategy Design Pattern; it has
filter - classes that implement
Filter
interface, used to make Filters for page encoding, restrict user for accessing specific pages, etc.
Question
How should project's directory layout look like? Is it OK to make it what is called package by feature?