SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Do you use DAO-level hand in hand with DTO?wiki wrote:Data transfer object (DTO), formerly known as value objects[citation needed] or VO, is a design pattern used to transfer data between software application subsystems. DTOs are often used in conjunction with data access objects to retrieve data from a database.
I don't see actually the Room classIs this Room object really a DTO?
stanislav bashkirtsev wrote:
Do you use DAO-level hand in hand with DTO?wiki wrote:Data transfer object (DTO), formerly known as value objects[citation needed] or VO, is a design pattern used to transfer data between software application subsystems. DTOs are often used in conjunction with data access objects to retrieve data from a database.
I don't see actually the Room classIs this Room object really a DTO?
You can create some text file to tune collaboration of your program and DB. Maybe is should be some kind of ResourceBundle with structure:
Hardcoding always lacks flexibility.
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
SCJP, SCJD
Anne Crace wrote:I hardcoded column names. I think it's more intuitive to the user, and also added a Record Number column, for the same reason. My table looks a bit more like a real database. I documented this in my choices.txt.
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Roel De Nijs wrote:
My solution provided a dynamic read of the database schema:
If a column is made bigger or smaller, it can be done without changing anything in the code (although that's not exactly true, because in the gui I used hard-coded values instead of using the information from the database-schema). I documented that (using database-schema in the gui) as outside the scope of this assignment.
If a column is added or removed, the only thing you have to change is the conversion method between my transfer-object and String[] (and vice versa). And of course also the GUI if the new field should be visible for the user.
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Roel De Nijs wrote:
I'll try to answer your question as good as I can:
l
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Bob Wheeler wrote:
I use a Room Cache, a Map<Integer, Room>, in the db layer to cache all records from the db. So I can only use the entries I have in my Room object, which is actually my DTO.
...
I have a Service class with bookRoom and findRoom, which creates or takes a room object. So yes, I think I can call it a DTO. But I also use my "DTO" as part of the room cache.
SCJP 1.5, SCJD 1.6
Ehsan Rahman wrote:
If I understand correctly, the data file records have been cached in terms of Room DTOs. Just out of curiosity, are data file records (of type String[]) also being cached in order for the public int [] find(String [] criteria) {} interface contract to still hold?
Ehsan Rahman wrote:
Re Hardcoding vs. Flexibility: I think that providing flexibility in the data layer in terms of extraction isn't difficult and the customer might appreciate this for a new field they want to display. However it is hard to know if the customer would always want a new field's data to be sent and displayed to clients (e.g. meta-data), so it might be better to keep such code fixed and readable for configuration.
SCJP 6 - SCJD - SCWCD 5 - SCBCD 5
JavaEnterpriseEditionFaq - TomcatFaq
Consider Paul's rocket mass heater. |