GeeCON Prague 2014*
The moose likes Java in General and the fly likes Programming theory - where is the best place to put code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Programming theory - where is the best place to put code?" Watch "Programming theory - where is the best place to put code?" New topic
Author

Programming theory - where is the best place to put code?

Karina Guenther
Ranch Hand

Joined: Sep 16, 2005
Posts: 55
The 2 problems I have are:
1. need to set a default start date and calc and end date for my page.
I can put this as jsp function on the page or put it in java code. I'm using spring so if in the java code should it be in the controller or in the object as a getter / setter with a calculation?

2. drop down hard coded list of values:
should this be an enum list in the object or in the controller? I can also put the values in a properties file. Having them as a table look up is not an option for me at this time due to time and design constraints.

What does best practices suggest for each of these?

Karina Guenther
Ranch Hand

Joined: Sep 16, 2005
Posts: 55
Oh by the way - the end date needs to be 90 days after the start date. And it needs to be editable by the user
 
GeeCON Prague 2014
 
subject: Programming theory - where is the best place to put code?