Solved

OO Design for a phrase

Posted on 2011-03-06
3
467 Views
Last Modified: 2013-11-12
An interviewer asked me to design a "Class Diagram" for following phrase. I could not asnwer what he expected.

Can some expert can design it in a object oriented way...

"A Person went to a Forest and wounded by a Tiger".

Thanks
Praveen
0
Comment
Question by:Mamtha1982
3 Comments
 
LVL 28

Accepted Solution

by:
pepr earned 250 total points
ID: 35054907
Start here http://en.wikipedia.org/wiki/Class_diagram

Basically, each object can be thought of being of some class.  The class defines (describes statically) the behaviour of the object. When thinking about the situation, you may sometimes think in terms "the object is closely related to its class" -- like in the situation.  This way, you have: a person, a forest, and a tiger.

There is some interrelation between them. And there are some actions of one entity towards the other entity.  Think about modeling the real situation by the objects. What must be the objects capable of (i.e. what must be described by their classes) to describe the situation? How can it be decribed graphically?  The key idea is to capture the abstract idea kept in our mind.
0
 
LVL 12

Assisted Solution

by:marklorenz
marklorenz earned 250 total points
ID: 35056039
They wanted you to pick up on the nouns and verbs and essentially put yourself into the problem domain (even though not realistic for real software design).

So, you would have a Forest that has-a Animals (with specialization being a Tiger) and a Person.  These classes of objects exist in the domain they gave you.

Besides the "is-a" and "has-a", there is also behavior (methods).  In the very small case here, there is "attack" or some such behavior of a Tiger, with a Person being able to be in the state "wounded".

This is a good read for UML class diagrams, but I'd recommend you read on UML more generally too so that you understand the methodology.

http://www.agilemodeling.com/artifacts/classDiagram.htm

Here is more UML:

http://www.agilemodeling.com/essays/umlDiagrams.htm

Besides online, I'd recommend Fowler's book UML Distilled as well as Larman's Applying UML and Patterns book.
0
 
LVL 12

Author Comment

by:Mamtha1982
ID: 35104998
Thanks you
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to Add same Index Array Elements in Octave 2 303
mangling a text file 4 285
equalIsNot  challenge 43 117
seriesUp challenge 7 107
Setting up SVN Server using Windows and Apache Purpose of the document:       This article will explain the process of how to configure SVN repository in a windows environment using APACHE web server. What is SVN? (http://subversion.tigris.org/) …
Pretext and Context: In this series, I wish to design the data model of systems in question. I will start by defining the scope and boundaries of the system, followed by subsystems involved, then finally the entities in those systems and subsystems…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now