This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Client side design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Client side design" Watch "Client side design" New topic
Author

Client side design

Prakash Krishnamurthy
Ranch Hand

Joined: Oct 08, 2002
Posts: 154
Hi,
I am stuck in the client design part. I am not able to maintain visibility of the proxy object across all the client classes.I realised that I needed to look through some design patterns.
I am not very familiar with design patterns. But, I skimmed through some creational patterns and found that factory and singleton could be used for our assignment. The only thing about factory that I wasnt sure was if I needed to defer the instantiation to the subclass, I did not feel the need for that.
Am I on the right track? What do you guys think?

Prakash
Prakash Krishnamurthy
Ranch Hand

Joined: Oct 08, 2002
Posts: 154
Can somebody answer this question for me?
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
You didn't get any answers because no one understood your question. What is your "proxy" object, and what do you mean by its "visibility"? And what does "across all client classes" mean?
Eugene.
[ February 14, 2003: Message edited by: Eugene Kononov ]
Prakash Krishnamurthy
Ranch Hand

Joined: Oct 08, 2002
Posts: 154
Well, I am sorry that I wasnt too clear about what I needed. Here's where I am and what I have done..
Actually, I am not very familiar with design patterns. I was reading various posts about the overall architecure and found one of this
"
Controller -> DataFacade -> DataProxy(returned by DataFactory) ->_Stub ( For remote access )
Controller -> DataFacade -> DataProxy(returned by the DataFactory) -> Data (For local access )"
If you do understand this, can you tell me what "Controller" means here? I also looked through the factory pattern and am not sure how I can use it effectively for this assignment and when I try to see the flow above it confuses me more!
My present design,
on the server is:
1) interface RemoteRequest extends Remote and has all the methods that needs to be accessed on the data class.(it throws all the appropriate exceptions)
2) Class Request implements RemoteRequest and extends UnicastRemoteObject and does the rebind.
3) There is the Data class that has all the code given to us and I have also implemented the CriteriaFind and lock, unlock
4) Lockmanager is also implemented.
On the client I am not sure what design I need to use. I am thinking how to use the factory pattern from there...I am still going through the many posts out here and I am not too clear. As of now, I have
1)a client class that does the lookup. I had used this to test my criteriaFind and locks,(which work well)

2)i also have Gui class where i had all my gui designed.( It still needs some things done)
I realised i would need some design patterns here...and then I turned to you for help!

Regards,
Prakash
Burk Hufnagel
Ranch Hand

Joined: Oct 01, 2001
Posts: 814
    
    3
Originally posted by Prakash Krishnamurthy:
...
Controller -> DataFacade -> DataProxy(returned by DataFactory) ->_Stub ( For remote access )
Controller -> DataFacade -> DataProxy(returned by the DataFactory) -> Data (For local access )"
If you do understand this, can you tell me what "Controller" means here? I also looked through the factory pattern and am not sure how I can use it effectively for this assignment and when I try to see the flow above it confuses me more!

The Controller is one of the trio found in the MVC design pattern. As its name suggests, it tends to control things. (See the FAQ page for a link to more MVC info.)
The arrows (-> indicate that one object is calling a method in another.
The DataFactory (search for Factory design pattern) returns a specific subclass at runtime based on some criteria (which criteria is up to the designer) -- in this case its whether the client is connected to the database locally or over a network.
Hope that helps. Happy weekend. Gotta go now...


SCJP, SCJD, SCEA 5 "Any sufficiently analyzed magic is indistinguishable from science!" Agatha Heterodyne (Girl Genius)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client side design