1
My project has the following packages in its structure:
- br.com.xxxx.model: Which contains the entities.
- br.com.xxxx.negocio: That contains the DAO interface along with the implementing classes.
- br.com.xxxx.control: Containing the Managed Bean’s.
- br.com.xxxx.util: Has the utility classes.
My question is the following: my DAO classes need to follow the DAO implementation, but depending on the entity I can have different behaviors, example a query that can have different fields.
How can I treat this? I could create an "extra" class with these differences?
Man, to be honest, I find this question very subjective, I believe that there is an ideal answer, each one can have an opinion, the very concept of MVC has evolved a lot and any system today has much more than 3 layers for example, what makes everything more dynamic still and everything to the liking of the developer... (Obs, did not give downvote)
– Kenny Rafael
I asked a lot of questions of this kind, with the experience I gave. Focus on your business rule and on delivering value to the customer/user. Make a well-written code that other programmers understand, with high cohesion, no repetition, which is great. Study, read and program that will arrive at your ideal solution.
– user26552
MVC in Java, right?
– Leonel Sanches da Silva
@Ciganomorrisonmendez yes
– Roknauta
Another question: the construction is following some framework specific or you are leaving for a pure implementation?
– Leonel Sanches da Silva
@Ciganomorrisonmendez I am yes, JSF.
– Roknauta
I wouldn’t duplicate this one? Organizing packages in a java project
– user28595