• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Have Two Factories implemented !

 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI friends ,
I am using two class factories that is a ConnectionFactory for the purpose of per client specific RemoteData object instantiation and one DataFactory at the client side for accessing data services in the remote or local mode as per the client specifics.
Then i have FlightFacade class acting as mediater between Client GUI related classes and data services,GUI is implemented using MVC that is three classes in assence for Model View and Controll.
Am I connecting GUI TO Data correctly,kindly comment.
[ November 10, 2002: Message edited by: Vikas Sood ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are, that is exactly how I had mine.
First Factory returns Connection Objects when in Remote mode only and is in the Registry.
The other Factory is for the client to tell it local or remote, and it returns an instance of the Data interface you created. And you wrap that class inside your Facade.
Mark
 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
Thankx for ur response.
Let me tell u further that I am also having an DataClient class that is the class which is making use of DataFactory class as mentioned above and this class is making use of FlightFacade as mediater between GUI classes and Data services.If u remember we discussed thin in one of my earlier posts as well where we were having a discussion regarding the use of Facde pattern in the assignment.
VikasSood
 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark and Vikas:
pardon my ignorance. Why do you need a Client connection factory? what I plan for my client is
it will have a main with rmi security and then all the Jcomboboxes(for arrival and destinatins)
and a JTable with the output of all these.
Then all I need to start the client, is a Commmand prompt and i bring up the GUI. right?
am I missing something? Again, as I said pardon my ignorance........

Prakash
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prakash, your client needs to run in local or remote mode, therefore you have two different implementation of your Data interface. So depending on the client asking for remote of local, the Factory there give you what you ask for, and the client doesn't have to know which type is being passed back, because it takes an instance of the interface.
In local mode there is no RMI so you will not have RMISecurityManager. I'd also suggest you remove all the SecurityManagers, you do not need them here, because there is no dynamic downloading, and besides your policy file is giving it AllPermissions anyway.
Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does DataClient have an instance of the DataAccessFacade? I am a little confused at this DataClient class.
If it has an instance of DataAccessFacade you are just extrapulating it out into more classes, which isn't good or bad.
I like the Controller having the instance of the DataAccessFacade and handling communication between GUI and Data.
Mark
 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
I just misinterpretted my relationship of FlightFacade with DAtaClient,in fact FlightFacade or DataAccessFacade (as in ur case) is going to make use of DataClient to act as a mediater between GUI and Data services.While my GUI will not have any knowledge of Dataservice methods implemented by DataClient.GUI will only make use of methods available in FlightFacade.
Kindly Comment
VikasSood
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, that is fine, but what is DataClient, is that your Data interface? or is it an actual class that you create an instance of?
My Facade wrapped around a DataAccess class which is my interface, so it would work with an instance of DataAccessRemote or DataAccessLocal since both class implement that interface which is my Data interface.
Mark
 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
My DataClient is the cliet side implementation class which implments DataService interface
same as implemented by Data and RemoteData classes used fo local and remote access of data
services.
Flow is like this:
GUIVIew > GUIController > GUIModel (MVC Implementation) >> FlightFacade (Mediator) >> DataClient (Client Side Data implementation) >> Data /RemoteData.(Data services).

What do u think of this flow,Kindly comment.
I have done my locking,and also have implemented seacrh alorithm (generic),and am now planning out the gui ,finally will take up documentation and testing.
VikasSood
[ November 13, 2002: Message edited by: Vikas Sood ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm still a litel confused, but that is probably becuase of my lack of sleep.
Here's my flow and see if you can match it to yours.

GUI---->GUI Controller---->DataAccessFacade---->DataAccess(remote or local)----->Data
Mark
 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,
I think my implementation is quite similar to urs apart from the fact that my GUI model is going to use an insatnce of facde intead of Controller as in ur case.
Am i right in my interpretation.
VikasSood
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic