Hello World!
I am back in the blogosphere after several months. The present course is called "Data Structures & Algorithms" and this week's focus is centered around installing Java and reviewing object-oriented design principles.
Thankfully the instructions embedded within the course made the installation of Java and IDE (integrated development environment) NetBeans seamless. The links provided to each website were straightforward (for the most part):
NetBeans (version 16): https://netbeans.apache.org/download/index.html
Java (version 19): https://www.oracle.com/java/technologies/downloads/
The 4 major principles of Object-Oriented Programming:
1) Encapsulation - The hiding of data implementation by restricting access to accessors and mutators. The pieces that surround the data that forms the class. An Accessor is a method that is used to ask an object about itself (Lewallen, 2005). This is typically in the form of properties. Mutators are public methods used to modify the state of an object while simultaneously shielding how the data is modified.
2) Data Abstraction - The development of classes, objects and types in terms of their interfaces and functionality. (Closely related to encapsulation). It is used to manage complexity such as to decompose complex systems into smaller components.
3) Polymorphism - One name, but many forms. This concept manifests itself by having multiple methods all with the same name - but slightly differing functionality. There is the overriding type (run time) and the overloading type (compile time). With overloading, the compiler determines what method will be executed when the code is compiled. The method that will be used for overriding is determined ar runtime based on the dynamic type of an object (Lewallen, 2005).
4) Inheritence - This concept refers to how objects are related to each other. Inheritance pertains to the "is a" relationship between objects. The Lewallen (2005) article likens this concept to the example of a library. A library lends out books as well as magazines and audio tapes. The library assets have their own class definition. Inheritance allows you to inherit functionality from another, called a superclass or base class (Lewallen, 2005).
Michael Streat
References:
Java T Point. (n.d.). Java OOPs concepts . Retrieved from http://www.javatpoint.com/java-oops-concepts
Lewallen, R. (2005). 4 major principles of object-oriented programming [Blog post]. World Documents. https://vdocuments.net/4-major-principles-of-object.html
Oracle. (2015). Lesson: Object-oriented programming concepts . Retrieved from http://docs.oracle.com/javase/tutorial/java/concepts/index.html
Comments
Post a Comment