Solved

OO Design for a phrase

Posted on 2011-03-06
3
470 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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