What is the is a and has a relation ship in oops concept in
java?
Answer Posted / crosseyed
Answer 4 and Answer 1 might both give simialr outputs but
their adoption depends on the size of a persons analytic
universe. And answer 4 is the better way to solve most
problems because it is easier to write and modify.
Much code is part of a system describing just the tiny part
of the universe an enterprise wishes to describe. If that
enterprise is a single product pizza manufacturer then for
such an enterprise the relevant universe is only pizza and
no other category of food exists to be extended in software
(profitably) by the manufacturer that is not some form of
pizza. The software engineer might wish to be a
nomenclature trailblazer, extending his code ever outward
in describing the whole universe of food. But pizza makers
are far too stingy to pay for trailblazing.
On the other hand if the enterprise is a supermarket then
the class food might (but shouldn't) be seperated from
classes for school supplies, medications and so on and
extended to include types of food. But is bagel pizza
really pizza? What about pizza crusts? Pizza crusts with
tomato sauce but no other topping? What about club soda
marketed as a cleaning supply? What about mouthwash
marketed as a cure for an alcoholics DT's? Where will we
draw the lines?
If in either case you were to use inventoryItem as a class
and add only properties sufficent to perform an inventory
you may not be trailblazing the catalogue of the worlds
foods and other stuff, but you will have much more easily
written and modified code.
World class descriptions of the universe may be a grand
ideal - but sometimes all you need do is count the number
of pepperoni pizzas! Describe only what is needed for a
purpose. Tofu, after all, can taste like fish or foul and
even Plato might not be able to categorize all its
variations depending on his ability to percieve spices!
But a store has only to tell how much of the various
packages they own sells best and how many of those are left.
Is This Answer Correct ? | 3 Yes | 10 No |
Post New Answer View All Answers
what do you understand by synchronization? Or what is synchronization and why is it important? Or describe synchronization in respect to multithreading? Or what is synchronization? : Java thread
What is the public field modifier?
What is the history of java?
How variables are stored in memory?
Can we override private methods?
What does snprintf return?
What is ascii code?
What is annotation in java?
Explain 5 io best practices?
Why does java have different data types for integers and floating-point values?
How do you create a method in java?
What is a char in java?
What are the important features of Java 9 release?
Tell me about different OOPS concepts.
Implement 2 stacks with just 1 array. The stack routines must not indicate overflow unless every slot in array is used.