Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: URLyBird v1.2.3 design question

 
Tiger Hilton
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it ok to have an adapter class which implements the DBClient interface instead of the Data class implementing it? Because I saw a post in which someone said
Many people, including myself, created a data adapter that provides access to your data class. You could make two adapters, one for each connection type, that implement an interface that defines the actions performed by the client, such as findRooms and bookRoom. Of course, that's just a suggestion

and it would be like Max's design then?
But thats breaking the
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:

requirements isnt it?
Thank you for your help if you'd be so kind.
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tiger,
Is it ok to have an adapter class which implements the DBClient interface instead of the Data class implementing it.

No it is definitely not OK, because that would mean that your Data class does not implement the DBClient (Sun-supplied) interface, right? The assignment instructions are pretty clear on that point, I think.
However, you are free to use adapter classes to do whatever you think you need to do. In other words, the only part of the quotation above that I object to is the "instead of the Data class implementing it" part.
Hope this helps,
George
 
Tiger Hilton
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is Max's design:
GUIController
|
DBAdapter- - - -implements- - - -DBAccess
|
Data

This is what Sun expects?:
GUIController
|
Data- - - - - - -implements- - - -DBAccess

How do you include an adapter when Data implements DBAccess?
Sorry I'm not cluey in this.
With thanks,
TH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic