Andy897
Andy897

Reputation: 7133

Should all servlets reside in one package

Is it a good practice to put all servlets in one package ? And if it so, is there any convention of standard practices for naming servlet package?

Upvotes: 0

Views: 64

Answers (2)

Shishir Kumar
Shishir Kumar

Reputation: 8201

No, it is not necessary to do so. In fact there is no standard naming convention for servlets. You can choose your naming convention based on your logic and architecture.

Classes are typically arranged by technical and/or functional domain. So the servlet could be in a package.

  • com.xyz.employee.web (all the web-related stuff of the app), or
  • com.xyz.employee.salary (all the salary-related stuff of the app), or
  • com.xyz.employee.web.salary (all the salary-related stuff of the web technical domain), or
  • com.xyz.employee.salary.web (all the web-related stuff of the salary-related functional domain).

Extracted from standard naming convention for servlet package?

Shishir

Upvotes: 1

QuestionEverything
QuestionEverything

Reputation: 5097

The accepted answer in this thread might help you:

standard naming convention for servlet package?

Also, follow the standard naming conventions of oracle.

http://www.oracle.com/technetwork/java/namingconventions-139351.html

Upvotes: 1

Related Questions