OOP is the tasteful interaction between objects to achieve a common goal. A properly object oriented solution ensures that all the objects share the same level of responsibility (weight), and all the objects follow the Single Responsibility Principal (SRP). The SRP states that an object should focus on one thing and it should do that one thing well. The OOP lends itself
Assignments are located here.
Crusty Apple PIE?
- Composition
- Abstraction
- Polymoripshm
- Inheritance
- Encapsulation
"Has a"
Composition (Aggregation) is when an object contains another object. Objects that contain many other objects can be hard to test. Composition leads to objects that are tightly dependent on each other. Dependency injection is a programming technique that reduces the tight dependency between objects.
To abstract something means to hide away the implementation details.
When you call/use the function/class you don't have to understand exactly what it is doing.
- Keywords/concepts:
class
interface
"Is a" or "Can be"abstract
- Methods/functions
- Classes
- Web APIs
- Software Development Kit (SDK)
Literal translation is "many forms" or "the condition of occurring in several different forms."
- Keywords
@Override
abstract
Refers to the bundling of data, along with the methods that operate on that data, into a single unit.
- Keywords
public
protected
private
"Is a"
Inheritance lets one object acquire the properties and methods of another object.
- Keywords
extends
implements
?
- Java only supports single inheritance, other languages such as Python support multiple inheritance
- The
public
andprotected
properties are fully accesible
A method is a subroutine or a function, but not both. A subroutine is code that possibly changes the state (data) of an object but does NOT return anything. A function is code that returns something but does NOT change the state of the object.
- Avoid heavily nested objects, prefer only one or two levels of inheritance.
- Use the
final
keyword in your classes to indicate to other developers that the class should NOT be subclassed/extended. - Remember the Golden Rule
- Objects can be
null
whereas primitive types cannot. - Unified Modeling Language (UML) is a standardized modeling language consisting of an integrated set of diagrams, developed to help system and software developers for specifying, visualizing, constructing, and documenting the artifacts of software systems, as well as for business modeling and other non-software systems.
- A group of objects that work together can be organized into a package.