*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes tableModel+facade Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "tableModel+facade" Watch "tableModel+facade" New topic
Author

tableModel+facade

tom mcmorrow
Ranch Hand

Joined: Jan 11, 2002
Posts: 39
hi mark
perhaps you could help me. I read in one of your posts where you used a facade on the client side.
i have also attempted a somewhat similar approach.
However i have also a table model class which communicates directly with the DataClient interface. Don't know if it looks right. Should it communicate with data through the facade.
My facade includes a method which returns a reference to the table model.
Thanks for being so generous with your time and suggestions.
tom
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

However i have also a table model class which communicates directly with the DataClient interface

So what you are saying is that your Table Model is tightly Coupled to your DataClient interface. Well, in some ways you need some kind of coupling. However, you could have it the other direction. Based on your quote above, I would assume that your TableModel class has a reference to your DataClient, and through that reference calls a method.
If that is so, I would say to redesign your TableModel. Try making a method on your table model accept as a parameter a DataInfo[] to display in the table, then your TableModel knows how to display these arrays, and then your can also have it pass it a FieldInfo[] and from that make up the Headings of the table.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: tableModel+facade