DTO is short for Data Transfer Object , which is why it is used to transfer data between classes and modules of your application.
DTO should contain only private fields for your data, methods of obtaining, installation and constructors.DTO not recommended to add business logic methods to such classes, but you can add some util methods.
DAO is an abbreviation for Object Access Object , so it must contain logic for retrieving, saving, and updating data in your data warehouse (database, file system, etc.).
Here is an example of what the DAO and DTO interfaces will look like:
interface PersonDTO { String getName(); void setName(String name);
MVC is a broader model. DTO / DAO will be your model in the MVC pattern.
It tells how to organize the whole application, and not just the part that is responsible for finding data.
As for the second question, if you have a small application, everything is fine, however, if you want to follow the MVC pattern, it would be better to have a separate controller that would contain the business logic for your frame in a separate class. and send messages to this controller from event handlers.
This will separate your business logic from presentation.
Petr Jan 16 '13 at 19:40 2013-01-16 19:40
source share