Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask English Expert

In this case, creating separate subclasses of Car is more trouble that it is worth, because the inventory program probably does not have to treat different models of cars in different ways. Therefore, it is probably more appropriate simply to designate the make of the car in a field of the class, as illustrated in the UML class diagram below.

The larger question at play is this: "What characteristic of an object is significant enough to warrant a subclass rather than simply data in a field?" Think about an application in your field of expertise and the classes that you would define for that application.

Post a response that describes the application you choose and the class within that application. Identify one or two key distinctions within that class that would prompt you to create subclasses instead of fields within the main class. Explain your reasoning, giving specific examples of objects in each of the classes and subclasses you discuss, and draw a UML class diagram to support your claim.

EXAMPLE:

Basically this diagram shows that you do not need to create 4 classes (Car, Ford, Volvo, Toyota), you only need 1 class called Car with the make of the car as our extra field to distinguish the different car makes (the bottom UML calls this car make as type and declares it as a String with "type : String", I would personally call it "make : String" ;-) Anyway, same thing...

So this is an example of when NOT to create too many classes when just 1 is enough to capture all the various Car makes provided we include this "type: String" field in the class itself.

for an Organism. I cannot create a single class called Organism and slap in there the name of the organism and perhaps the size. There are just too MANY other unique characteristics that would help me characterize each of the various organisms. So I will need to create a class hierarchy. The first characteristic is whether the Organism is a Plant or Animal. These organisms are so different that I need to create 2 subclasses (children classes) under the parent Organism class.

So this leads to 1 parent and 2 subclasses so far. Then I take the Animal class for example. Again, I cannot stop here because there are so many different kinds of Animals. What types? Well, Mammals, Fish, Snakes, etc. These are soooo different in terms of characteristics that again, I am best-served to define another level in my hierarchy to be able to distinguish the various animals. Similarly there are different kinds of Plants (Trees, Flowers, etc) and you can then even go deeper and break the Trees into Fruit Trees and Shade Trees or whatever.

The bottom line is that 1 parent class is NOT enough when we need a HIERARCHY or TAXONOMY to represent the many different types of organisms. So the trick here in answering this question is to think of a hierarchy to help you define say the first 2 levels (parent and children) of this hierarchy. You do not need to go to 4 levels as I did with , , , -grandchildren), just 2 levels for L1 and L2 is enough as long as you explain why you need 2 levels as I did.

English, Academics

  • Category:- English
  • Reference No.:- M92497968
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in English

Reportread the case study and develop your it support

Report Read the case study and develop your IT support strategy. MedTec Limited (MTL), a small local software company in Greenlane selling medical software to medical clinics, is planning to expand their store next year ...

Jesuss teachingubbl230 lukeactsread luke 612-856 as you

Jesus's Teaching UBBL230 Luke/Acts Read Luke 6:12-8:56. As you read through the passages, prepare responses to the following questions: a) Identify 3-5 elements of this material that you find especially striking, surpris ...

Question observe an event in your community family or

Question ; Observe an event in your community, family, or online. Record the practical elements during your observation. Identify and summarize what you observed and include any questions or impressions that you had duri ...

Case study gen y in the workforce by tamara j ericksonin

Case Study : Gen Y in the Workforce By Tamara J. Erickson In this fictional case study, a Generation X manager at a multimedia production and distribution company must decide how to work effectively with her recently hir ...

Make sure to answer the following questions and no less

Make sure to answer the following questions and no less than 400 words. For Kant, how are moral principles developed? Do you think that human reason is better than human emotion, when deciding moral issues? What are the ...

Question chapter 04 my movie log exploring story and plot

Question: Chapter 04 My Movie Log: Exploring Story and Plot in Singin' in the Rain (Due by 11:59 pm Sunday, October 7th) The Chapter 04 My Movie Log is based on our class screening of Singin' in the Rain and this week's ...

Question read elizabeth cady stantons the solitude of self

Question: Read Elizabeth Cady Stanton's "The Solitude of Self" while taking 3 pages of double-entry notes. As you do so, be looking for specific BVE (beliefs, values, and expectation) of Stanton's. Try to be as specific ...

Question for this assignment you will use all the

Question: For this assignment you will use all the rhetorical triangle skills you have so far! Your goal is to find a visual argument and give a complete analysis of it. Visual arguments can be found in the form of comme ...

Assignment compare and contrast bookscompare and

Assignment: Compare and Contrast (Books) Compare and Contrast: Look up all of the books from the list below and write a 2 sentence description about each one. Why do you think each book has been important throughout hist ...

Question this week you will be changing gears and moving

Question: This week, you will be changing gears and moving from narrative writing to beginning on the informative paper. For this assignment, please review the directions for the Week 5 assignment and think of a topic yo ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As