4 Pilars of Object Oriented Design

2320 WordsJul 23, 201410 Pages
De La Salle University-Dasmariñas College of Engineering, Architecture and Technology Engineering Department- CPE FOUR PILARS OF OBJECT ORIENTED DESIGN HOMEWORK NO.3 Submitted By: Depone, Carmela R. CPE52 Submitted To: Mr. Dwight Sabio Instructor Date Submitted: August 4, 2014 ABSTRACTION A model of a complex system that includes only the details essential to perspective of the viewer of the system or Only the characteristics of the system that are essential to the problem being studied are modelled; minor or irrelevant details are ignored. Example and Explanation * An abstraction is a model of a complex system that includes only the essential details. * Abstractions are the…show more content…
However, in one way, inheritance actually breaks encapsulation! * As already mentioned, Encapsulation is the process of packaging classes into the public interface and the private implementation. * In essence, a class hides everything that is not necessary for other classes to know about. * It makes a case that when using inheritance, Encapsulation is inherently weakened within a class hierarchy, Because it introduces a specific risk as Inheritance connotes strong encapsulation with other classes but weak encapsulation between a superclass and its subclasses. * The problem is that if you inherit an implementation from a super class and then change that implementation, the change from the super class ripples through the class hierarchy. * This rippling effect potentially affects all the subclasses. At first, this might not seem like a major problem; however, as we have seen, a rippling effect such as this can cause unanticipated problems. * For example, testing can become a nightmare. * But with proper implementation of Encapsulation makes testing systems easier. Reference [1] Encapsulation, updated last April, 2014, Available: http://guruzon.com/1/oop-concepts/encapsulation/what-is-encapsulation-example-tutorial-how-to-use INHERITANCE Inheritance as its name implies, involves inheriting attributes and behaviours from other

More about 4 Pilars of Object Oriented Design

Open Document