?
Solved

OO Design for a phrase

Posted on 2011-03-06
3
Medium Priority
?
477 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:Praveen Kumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Accepted Solution

by:
pepr earned 1000 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 1000 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:Praveen Kumar
ID: 35104998
Thanks you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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/) …
Introduction This question got me thinking... (http://www.experts-exchange.com/questions/28707487/GLOBALS.html) Why shouldn't we use Globals? This is a simple question without a simple answer.  How do you explain these concepts to a programmer w…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 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