If we use if-else with polymorphic behavior, then why do we use abstraction?
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
Abstraction allows the developer to separate objects so that they can work on different levels of detail more easily. For instance, if you are defining an object-oriented application to model a zoo, you can define a base class "animal", then derive "reptile", "mammal", "bird", and "fish" from it. The "animal" class implements the attributes and actions of all animals. Each of the derived classes refines those attributes and actions to a finer level of detail.
For More Information
- Dozens more answers to tough database design questions from Pat Phelan
- The Best Database Design Web Links: tips, tutorials, scripts, and more
- Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
- Ask your database design questions -- or help out your peers by answering them -- in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.
Related Q&A from Pat Phelan
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.