• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

best MVC model with correct package structure

 
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose I am developing a simple jsp-servlet application for manage customer information. So i want to know what would be the best package structure and how controllers should be there in this case.

So the main actions would be insert, edit, delete and view customers in this case.

I thought of having a one controller called MainController for identify those 4 actions.
Or else should i need to have 4 controllers for each action?

One DAO class called CustomerDao for manage all database related stuff

One DTO class called Customer for transfer customer data and Util class for common actions

But i am confuse here what should i need to have under domain. Does under domain where the business logic should reside. Though this application is simple enough, is it correct to have class for example like ManageCustomer which call the necessary DAO action. The controller shouldn't need to directly call the DAO right? It should go across domain and domain access DAO right. I am correct here?

But what i believe correct is that business related logic's belongs to a class under a package something like service right? If so what should domain classes do?

So currently i have below packages,

test.controller
-MainController
test1.dao
-CustomerDao
test1.domain
-??
test1.dto
-Customer
test1.util
DBUtil


Please help me to clear this out and to get know a best practice approach for this kind of a project or more advanced one?

 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic