Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do you have to use all methods of DBAccess?

 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am fairly certain that you have to make sure all the methods of the required interface have to work, and there is no doubt that you cannot change DBAccess in any way. I have searched extensively on this site about this topic. I am fairly certain that they do have some sort of automatic testing program to check that you did that. My issue is that I cannot get my TableModel to work with findByCriteria(String[]). I have my controller actually doing that task and it works seamlessly. I did get findByCriteria to work with a driver class that just passes in the String arrays. I am just wondering if it is OK to not call those methods from my actual application. I find it easier (and probably better) to use collections to hold the data.
 
Gabriel Vargas
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anne,

I agree with you is easier manage Collections instead of arrays . I implement a solution based on collections and i implement that conversion in my value object, and only where is neccesary i use arrays like in the interface. I need two methods, one to convert from array to my value object and another to convert from my value object to the array. I think that conversion is not good in the controller because the purpose of the controller is controls the flow of the application :roll: , it seems to be better in the model, for this reason i put that in my value object. It seems to be the place for an adapter over the interface provided by Sun .

I hope it helps you.
 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Gabriel,

My controller has methods that return an UrlyTableModel object(my model). My TableModel is very much like the one in Andrew's book, except it has another argument, an int, for the record number. That was tricky, gettig it to persist that record number so it held the original number for the view. My value object only has setters and getters. It has an empty (default) constructor and a constructor that initializes all the class variables. I thought this should be very much like a bean, or a domain object. I use domain objects at work. I am working on a large Hibernate/Spring application. I think no work of this sort should be done in the value object. It is just there to call the setters and getters, and constructors. I am going to do more research on this, as you are probably correct that maybe it shouldn't be done in the controller, either.
 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again, Gabriel,

I found this: link
It might clarify Value Object. I'm not sure how you set yours up, but it supposed to be like a bean, as this post states. I will have to look at Adapter pattern, too. I may have to add it to my file reader class. I tried moving the searching logic from the controller to the Data class, and that is where I am stuck. There is actually a part of my file reader class that I am not using( and it doesn't work ) that probably should be checking that criteria for a match. Hopefully, I can keep most of the code because I do have it working.
 
Gabriel Vargas
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anne,

Maybe you are right and there is not the place to put the convertions (but i look there is the most apropiate place for my case, but i lost some marks in the gui section maybe for this). I put an adapter between my data class and my controller class and in this adapter i put the search specified by the user interface and this could avoid you to move this logic to your data class, and the controller calls the methods of the adapter instead of the methods of the data class. I think this logic is not for the file reader class, i think my aplication in layers where the output from one layer is the input for the next layer (sun makes things difficut with the data class, this must be a layer) and i find this better for my design.

I hope it helps you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic