Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Have some questions, please help

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'v already finished my URLyBird booking system, but now I found some "musts" in the asignment which make me doubt.
Could you please say if I was wrong in my desigions.

1. My GUI provide the same seach functionality as the interface Data: every search criteria matches a record field that begins with this criteria; the GUI does not allow to switch between "and" and "or".

But in the asignemnt I can read

The User Interface ... must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.



2. My RMI server interface looks totaly other than the Data. I only provide methods, needed for my GUI.

But the asignment say:

Your server ... must provide locking functionality as specified in the interface provided above.



Does it mean, the server interface must provide the same methods, like in the Data?

3. My GUI client starts in the network or local mode depending on the start arguments. After that the GUI allows to specify only the location of a remote or the location of a local database.

But in the assignemnt I found

the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used



Does it mean, the GUI must allow the user to select, whether a local or remote database is to be used?

Thanks!
 
Sergiy Kononenko
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for errors and bad english
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sergy,
1) You still have some work to do to satisfy the requirements. You may find this link helpful.

2) The server interface does not have to provide the same methods as Data. You should only expose the methods you wish (or need) to.

3) Quoting fully... "In either case, the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely." I understand this to mean the command line argument should specify the start mode, standalone mode or connecting to a remote database.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Fola!
Thanks for helping with his first question!

Howdy, Sergiy!
Partner, even though you won't be using all methods present in the interface that was provided to you (such as create or delete), I advise you to provide all of them in your remote interface. If these functionalities are added in the future, they are already there. Also, you have to implement all methods in your Data class, even the ones you won't be using.

Fola Fadairo wrote:I understand this to mean the command line argument should specify the start mode, standalone mode or connecting to a remote database.



Exactly!
 
Sergiy Kononenko
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roberto Perillo wrote:

Howdy, Sergiy!
Partner, even though you won't be using all methods present in the interface that was provided to you (such as create or delete), I advise you to provide all of them in your remote interface. If these functionalities are added in the future, they are already there. Also, you have to implement all methods in your Data class, even the ones you won't be using.



Thank you Fola.
Thank you Roberto.
For me this is not a question of design, this is rather a question of understanding: must the server provide locking functionality on it's interface or not. I was doubt at this must-statement in the asignment:

Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface provided above.

 
Sergiy Kononenko
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't use locking functionality in the GUI directly. My server provide a method "book" on it's interface, which do the whole job: lock, check, update, unlock.
 
Fola Fadairo
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that satisfies the requirements, but I know there are other opinions. I think it is a design issue.
 
Roberto Perillo
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sergiy Kononenko wrote:For me this is not a question of design...


Sergiy Kononenko wrote:My server provide a method "book" on it's interface...



Partner, the locking mechanism ends up making you take some design decisions. For instance, you said that your server provides a method called "book". Are you sure this is the best place to put this method? The server is more related to infrastructure, so in my opinion, it's better to have a business/services layer that uses the server, which has methods like lock(), update() and unlock(), and put the book() method in the business/services layer. From this method, you use the locking mechanism, provided in the server.
 
Sergiy Kononenko
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roberto Perillo wrote:

Sergiy Kononenko wrote:For me this is not a question of design...


Sergiy Kononenko wrote:My server provide a method "book" on it's interface...



Partner, the locking mechanism ends up making you take some design decisions. For instance, you said that your server provides a method called "book". Are you sure this is the best place to put this method? The server is more related to infrastructure, so in my opinion, it's better to have a business/services layer that uses the server, which has methods like lock(), update() and unlock(), and put the book() method in the business/services layer. From this method, you use the locking mechanism, provided in the server.



Now I understand: you call "server" the data access class "Data.java" and I mean the whole server-side system - RMI + service layour + database.

But why you call the data access class "server"?
How do you instantiate and start your class?
My class Data has only one constructor with parameter of type File. It works only as a part of server-side data-management system.
This was also a big puzzle for me - how Sun going to test this class automatically if they do not specify how to supply a database file to it?
Maybe I am completely wrong, please correct me.
 
Roberto Perillo
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sergiy Kononenko wrote:Now I understand: you call "server" the data access class "Data.java" and I mean the whole server-side system - RMI + service layour + database.



Yeah, me too, partner. You got it wrong. The Data class can be used in the server environment as well, but it can also be used separately (in standalone mode).

how Sun going to test this class automatically if they do not specify how to supply a database file to it?



What I believe is, every time they are going to test the Data class of an assignment, they adapt the way they get a reference to it, and from there, they run their tests (sometimes, there are other things to do before that, like in my case, where you have to call a method to load all records to memory). Because in some projects, people choose to make the Data class a singleton, others choose not to make it a singleton, so the way people code varies a lot, and they do not impose a format of how the Data class should be. So, it shouldn't be a problem, as long as the functionalities you're supposed to implement are implemented correctly.

I don't know if you're aware of, but sometime ago I posted here in the ranch the tests I created to run against my Data class, which can be found here. If you need it, there it is!
 
Sergiy Kononenko
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roberto Perillo wrote:

Yeah, me too, partner. You got it wrong. The Data class can be used in the server environment as well, but it can also be used separately (in standalone mode).



Could you please explain more precisely what I got wrong, Robereto?
I also use the data access class in both cases. But every time I instantiate a new object of Data. I do not keep alive any common instance of it.
 
Sergiy Kononenko
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sergiy Kononenko wrote:

Roberto Perillo wrote:

Yeah, me too, partner. You got it wrong. The Data class can be used in the server environment as well, but it can also be used separately (in standalone mode).



Could you please explain more precisely what I got wrong, Robereto?
I also use the data access class in both cases. But every time I instantiate a new object of Data. I do not keep alive any common instance of it.



Excuse me. Roberto, of cource.
 
Roberto Perillo
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sergiy Kononenko wrote:Could you please explain more precisely what I got wrong



It's just that I also consider as being "server" the whole thing (RMI, Data class, etc).

But every time I instantiate a new object of Data. I do not keep alive any common instance of it.



That's ok, partner. As long as you implement correctly each functionality that you must implement (the ones present in the interface provided to you, the locking mechanism, etc), it should be ok.
reply
    Bookmark Topic Watch Topic
  • New Topic