Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Oriented Analysis/Design

 
Prasanna Raman
Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Junilu Lacar
Bartender
Pie
Posts: 7773
62
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?"
 
Matt Weisfeld
author
Greenhorn
Posts: 24
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Prasanna Raman
Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 24
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 398
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Matt. I'll start out with the book you've suggested then.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic