aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Object Oriented Analysis/Design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Object Oriented Analysis/Design" Watch "Object Oriented Analysis/Design" New topic
Author

Object Oriented Analysis/Design

Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 335
Hello,

I have learnt the principles of object oriented programming well and I think have a good understanding of the concepts - polymorphism, interfaces, abstract classes, inheritance, encapsulation etc. But when I am asked a question in an interview, like how to design "Cards" or a "Zoo", I am not able to come up with answers. When I start thinking about a design, for example Zoo, I just think Animal class, Lion class etc. One or two of the classes might make sense but I know I am not really understanding the problem and coming up with the best solution. I just think in terms of classes because that's the only thing that comes to mind.

How do I start getting better at this? I don't have a job where I can learn this, but I really want to learn this.

Thanks,
Prasanna
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8008
    
  22

Prasanna Raman wrote:How do I start getting better at this? I don't have a job where I can learn this, but I really want to learn this.

Simple answer: practise.

Write some programs. Make some games. Put your knowledge to the test without a book to help you (at least to start with).

Take your Zoo example: Why not write a little ZMS (Zoo Management System) program? And if you don't want to tackle something quite that big, how about a feeding system for the animals?

Until you've been through some of the business (and pain ) of actually designing and implementing a system, all that knowledge will be just what it is: knowledge - without any practical experience.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4745
    
    7

OO analysis and design is not about taking something like a Zoo and just going off and creating "objects" that mimic the real-world objects you'd find in a Zoo. OO is about organizing responsibilities and the data that help fulfill those responsibilities. So when someone asks "How would you use OO for a Zoo?", the first thing I would ask is "What is it about a Zoo that you'd like to encode in a computer program?"


Junilu - [How to Ask Questions] [How to Answer Questions]
Matt Weisfeld
author
Greenhorn

Joined: May 01, 2013
Posts: 24
    
    5
Hi Prasanna,

Each organization is going to do thing differently, but the main thing would be to concentrate on the interfaces with the systems that class needs to interface with. The bottom line is getting the job done and everyone is going to have a different approach to doing that. For example, if you are asked to create a Zoo class, that may really be the wrong way to approach the interview. The primary question would be what does the required application need to do and what systems are already in place to do it. The new class may simply be a wrapper to encapsulate functionality that already exists. In any case, you would first need to do the analysis and come up the requirements.
I guess the short answer is that a class won't stand alone, it will be part of an object model that is meant to implement an application. So asking you to describe a single Zoo class may be a loaded question.

Does that help?

Matt

Matt Weisfeld
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 335
Hello Matt,

Thank you for your response. I just took Zoo as an example; what I meant to say was that I am totally lost trying think of designs like this one. I don't know where or how to start, how many classes, interfaces, and why so many classes - questions like these.

Thanks,
Prasanna
Matt Weisfeld
author
Greenhorn

Joined: May 01, 2013
Posts: 24
    
    5
OK - have you read many books or Internet articles on design patterns. This may be a good place to start if you are interested in how to implement object-oriented designs - at least from the practical standpoint. There are also some good books on the topic. This one was written in 1998, but it has always been one of my favorites.

http://www.amazon.com/MWSS-Object-Oriented-Design-Mitchell-Signature/dp/1571691340
Prasanna Raman
Ranch Hand

Joined: Sep 05, 2010
Posts: 335
Thank you, Matt. I'll start out with the book you've suggested then.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object Oriented Analysis/Design