Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Encapsulation, Inheritance and Polymorphism are some basic concepts of object - oriented programming. These are vital concepts, but they are used in daily life. By
Encapsulation, Inheritance and Polymorphism are some basic concepts of objectoriented programming. These are vital concepts, but they are used in daily life. By looking at everyday examples, it can help us understand these in development. Begin by reviewing the following three documents:
Part I: Classes Encapsulation
Encapsulation refers to the combining of data and code into a single object. Data hiding refers to an objects ability to hide its data from code that is outside the object. Only the objects methods may then directly access and make changes to the objects data. An object typically hides its data, but also allows outside code to access its methods. Going back to the three drawings, you have been asked to create a software plan that would allow the developer to keep each of the plots of land separate for inventorytracking purposes but without having to recreate the wheel for every plot. Some of the things you will want to consider are: Plot Size, Plot Premium, House Allotments as you can see, the smaller squares can hold only smaller houses AddressesLocation House Selected to go on a plot, the same houses cannot go next to each other according to the county All house building supplies for the particular house: Flooring, Counter tops, Color Siding, etc
For Part I:
Write a description of how you would handle this situation.
Create a class diagram for the basic plot.
Part II: Classes Inheritance
When an is a relationship exists between objects, it means that the specialized object has all of the characteristics of the base object, plus additional characteristics that make it specialdifferent
Inheritance involves a superclass and a subclass. The superclass is the generalbaseparent class and the subclasschild is the specialized class.
The developer has decided that instead of coming up with a brandnew floor plan for each separate model home, they want to come up with a base home plan, so note the similarities and differences between the two main floors.
For the nd part, address the following questions:
What would you include in the base home plan? Note: The base home plan should be as generic as possible but include everything that both of them should have. Remember you can change sizes and some features.
What would you addchange in the home plan for Home Remember it would automatically inherit everything from the base home plan.
What would you addchange in the home plan for Home Remember it would automatically inherit everything from the base home plan.
Now create the baseclass and subclass diagrams in Visio.
Part III: Classes Polymorphism
The term polymorphism refers to an objects ability to take different forms. It is a powerful feature of objectoriented programming. In this section, we will look at two essential ingredients of polymorphic behavior:
The ability to define a method in a superclass, and then define a method with the same name in a subclass. When a subclass method has the same name as a superclass method, it is often said that the subclass method overrides the superclass method.
The ability to declare a class variable of the superclass type, and then use that variable to reference objects of either the superclass or the subclass types.
The developer is looking at all the options for the houses. Review the Options drawing and note all of the different bathroom options. So if you create the base floor plan boxed in red you then need to determine all the options for the bathroom. Hint: The method name may be something like bathing, etc. We are using a floor plan, and we are using a bit of creative license here with methodsvariables
For Part III, provide new responses that address the following:
What would you now include in the base floor plan?
What would you change for each of the various bathroom options? What methodsfeatures would you override from the base class? Note that here are different bathroom options
Now create baseclass and subclass diagrams.
Part IV: Class Diagrams
Now it is time to put it all together. You have been asked by the company to put the class diagrams together starting out with the plot diagrams. Utilizing what you have already designed, put them all together for a full plan to demonstrate how you plan on developing the housing development program.
For Part IV address how you will implement the program:
How would you write a program to allow users to shift from working with plots to the houses?
What modules would you develop to align all the various options?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started