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

Jar File, Design.txt

 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can someone please tell me why we need to nest jar files, like client.jar, server.jar and gui.jar. Can't we instead have a single jar file with the same names folders in it? How do u justify this in your design choice?
And also in design.txt whats that we need to document?
Also is it real important to have the code stick to any of the design patterns? what if we don't use patterns? do we still pass the exam?
I've been seraching the previous posts but couldn't find any better answer for this.
Actually i've seen Mark's UML diagram, which imprest the most. But i am not well acquainted with these patterns.
Thnaks,
sri
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can someone please help me on this?
 
Sai Patnala
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See these lines from instructions...
>>>>>>>
Use of Standard Elements and Design Patterns:
The design should use standard Java package facilities wherever possible. Designs should not involve building new code if the effect can adequately be achieved using facilities in the standard Java packages. Performance alone is not a justification for ignoring this.
>>>>>>>>>
I have been using Singleton, Facade patterns. MVC architecture and their patterns are helpful in GUI module.
UML Diagram definitely helps. I would recommend start learning it.
[ May 22, 2002: Message edited by: Sai K Patnala ]
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seperate the jar files based on the purpose and the layer. For example, I had
fbnClient.jar - Contains files used only by the client
fbnCommon.jar - Contains common files used between the server and client
fbnServer.jar - Contains files used only in the server
fbnServerForClient.jar - Contains any server side classes used by the client and RMI Registry: _Stub and interfaces.
In the design document, you need to list all the major design decisions. For example: Why do you select RMI instead of Sockets? Why did you change the Data class instead of sub classing it? What is the reason behind using various patterns? Why do you have a RMI Factory to instantiate remote Data instances unique to each client?
I read in some thread that you can pass with out using design patterns. But I suggest you read the GOF book on design patterns and use some of them like Factory, Proxy, Singleton, Wrapper.
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai,
So can i infer that using design patterns is mandatory? And i fail if i don't use one?
thanks,
Sri
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai Prasad,
Thanks for that quick reply!!!
So is it ok if i make a single jar file instead of nesting jar files?
I have 2 folders db and ui. And am planning to package that into a single jar file.
As i am almost done with the coding part, now if i need to use design patterns then i would have to change all my classes. And do u still suggest me to go ahead with the learning part, and try implementing those patterns?
Thanks,
sri
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sri,
Well...Since you are done with the coding, I don't know how big is the effort for you to refactor it to use Patterns. You probably are using patterns with out knowing it. I sugget you give a try to read the book and see if you are already using any patterns in your code. If not try to add them wherever possible.
Your final submission is going to be one jar file. In that jar file you can have as many jar files as you want. I didn't submit an executable jar file and explained in the README.TXT about how to run the various programs.
Take your time and the goal here to learn as much as possible in Patterns, RMI, Threads etc.
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai,
That was a fast one!!
Thanks, i'll try reading about patterns and try understanding that. I've seen in Architect Forum,
http://www.javaranch.com/scealinks.jsp
that patterndepot.com is the best site for patterns, do u recommend any other.
Thanks,
sri
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the java version of GOF. That should help.
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for everyhting,
Sri
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai Prasad,
I just now read abt Factory Pattern. And i have a question on this.
In my application, i have a class which provides Client-Side RMI functionality, meaning if its a remote connection, then it instantiates Data Server via RMI lookup. And if its a lcoal conenction it provides local instantiation of Data Server Object. I have a method here which returns a variable saying its local/remote connection.
So, does this mean that this Client-side class is the Factory class?
Please let me know,
thanks,
Sri
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. I would rename the class with the suffix Factory.
 
Sri Addanki
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai Prasad,
Thanks!
Yes, i'll rename the class.
Now what's next, where does this interface and abstract classes come from? I see that factory pattern has this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic