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

interaction between DB front end

 
Lucy Sommerman
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so...I have done my DB and also the GUI.

How to pass data input/output between them?

Is this where the RMI stuff comes in...?

Sorry, thick question...all advice appreciated
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lucy Sommerman:
so...I have done my DB and also the GUI.

How to pass data input/output between them?

Is this where the RMI stuff comes in...?

Sorry, thick question...all advice appreciated


If your GUI has a MVC pattern basis, you will have a Model based on the database. In the standalone mode this will use the interface provided in your instructions to directly access the database.

Rich (or fat) Client
In networked client-sever mode the client will use a proxy that also implements that interface to access the database. The communication between the gui and the database will be over RMI or sockets.

Thin Client
Only the business methods are exposed to the client and all the business logic is on the server. It can use either RMI or sockets. This is easier, but may not actually meet your instuctions. People have passed using this though.
 
Lucy Sommerman
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - I have the pieces, just trying to put them together.

So...something like...
package suncertify.GUI;
import suncertify.db.*;

public class Model implements DBAccess {


}
..then code up my Model to access the DB and pass that info to the GUI. Is that the way forward? (just thinking standalone for now...will deal with RMI in a bit..)
 
Lucy Sommerman
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or model should be in its own package?
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lucy Sommerman:
Thanks - I have the pieces, just trying to put them together.

So...something like...
package suncertify.GUI;
import suncertify.db.*;

public class Model implements DBAccess {


}
..then code up my Model to access the DB and pass that info to the GUI. Is that the way forward? (just thinking standalone for now...will deal with RMI in a bit..)


I wouldn't have the model implement DBAccess, rather it should contain an instance of DBAccess that can either be the Data class or the DataProxy class that uses RMI.
 
Lucy Sommerman
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK I have my Data class which implements DBAccess. That's all good.

Currently I have
private static Data r;
within my GUI.

But I think this is wrong from a design point of view. do I need to add a 3rd component (model?) to contain an instance of the Data class, and then the GUI contains an instance of the model class, or accesses the model in some way? Seems a bit wrong to me to have the GUI working directly upon a Data instance...If I create a model, and have that work upon an instance of the Data class, how best to make GUI interact with model?

Sorry - never done this before...but done quite a bit of programming, jsut not MVC
 
Lucy Sommerman
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm..i appear to have the Model as an inner class of the GUI - is this ok>?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic