Object-Oriented Programming
Object-oriented programming organizes software around objects that combine state with behavior. Classes, interfaces, inheritance, and composition help you define how those objects are created and collaborate.
itSoftware engineering | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Object-Oriented Programming
Object-oriented programming is a way to organize software around objects: little custodians that keep state and the behavior that changes it in the same place. This is less mystical than it sounds. A bank account knows its balance and decides whether a withdrawal is valid, which is preferable to scattering the balance across the program like loose receipts.
The useful question is ownership. Which object owns this state? Which rule must stay true when that state changes? A class describes the kind of object, including its fields, methods, and construction rules. An instance is one particular object following that description. Two accounts can share a class while holding very different balances. No tiny office manager is required.
The first important trick is encapsulation. A public operation such as deposit expresses intent and can preserve a rule. A writable field asks every caller to preserve the rule forever, which is an ambitious project plan for any number of callers. Abstraction then keeps the public contract focused on the behavior a client needs, rather than every internal detail.
Collaboration is where the furniture starts moving. An interface states a capability that several concrete objects can provide. A client can depend on that contract instead of one implementation. Polymorphism lets the same call reach the applicable concrete behavior at runtime, so a drawing loop can ask each shape to draw without maintaining a growing type-checking ceremony.
Inheritance is useful when a derived type must honor the base contract. It is not a coupon for free code reuse. Composition means one object contains or uses another collaborator and delegates part of the work. That often keeps responsibilities separate when the relationship is not a true specialization.
Read the Intro for the full map of objects, contracts, relationships, and trade-offs. Use Slides when you need the relationships in one view. Keep the Cheatsheet nearby when choosing a boundary or checking terminology. The Practice Reference turns one required behavior into a model, and the Exercise asks the account question where it matters: can the design refuse an invalid transfer without leaving the rest of the system in a muddle? Field Notes covers the design costs that class diagrams tend to leave off the invitation.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://docs.oracle.com/javase/tutorial/java/concepts/index.html
Supports
- Objects as bundles of state and behavior
- Classes as blueprints for objects
- Inheritance of state and behavior
- Interfaces as contracts
- Introductory study path for object-oriented concepts
- https://docs.oracle.com/javase/tutorial/java/concepts/object.html
Supports
- Fields storing object state
- Methods exposing behavior and supporting object communication
- Data encapsulation through hidden state and method interaction
- Objects containing other objects
- Quiz answers about objects, encapsulation, and behavior-focused tests
- https://docs.oracle.com/javase/tutorial/java/concepts/class.html
Supports
- Classes as definitions from which instances are created
- Multiple instances following one class definition
- https://docs.oracle.com/javase/tutorial/java/concepts/interface.html
Supports
- Methods forming an object's interface
- Interfaces as contracts between classes and clients
- Implementing classes providing interface methods
- https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
Supports
- Base and derived class terminology
- Inheritance of eligible fields and methods
- Overriding inherited instance methods
- Derived objects usable through ancestor types
- Java single class inheritance
- https://docs.oracle.com/javase/specs/jls/se25/html/jls-8.html
Supports
- Classes as reference-type declarations
- Fields, methods, constructors, initializers, and nested types
- Access modifiers and inherited members
- Abstract and final classes
- Method overriding, hiding, and overloading
- https://docs.oracle.com/javase/specs/jls/se25/html/jls-9.html
Supports
- Interface declarations and members
- Interface implementation by classes
- Interfaces as common supertypes
- Multiple interface inheritance without a shared superclass
- Lack of interface instance variables
- https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/oop
Supports
- Abstraction, encapsulation, inheritance, and polymorphism
- Derived account types sharing base behavior
- Virtual methods and overriding in an evolving example
- https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/
Supports
- Type definitions as object blueprints
- Encapsulation and member accessibility
- Fields, methods, constructors, properties, and other members
- Class inheritance and multiple interface implementation
- Distinctions among classes, structs, and records
- https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/object-oriented/polymorphism
Supports
- Derived objects used through base-class references
- Runtime selection of overridden virtual behavior
- Uniform client work across related concrete objects
- Quiz answers about dispatch and type branching
- https://docs.python.org/3/reference/datamodel.html
Supports
- Objects having identity, type, and value
- Attribute access and class instances
- Special methods and object-model customization
- Multiple base classes in Python
- Language-specific equality and lifecycle study
- https://docs.python.org/3/tutorial/classes.html
Supports
- Python class and instance objects
- Inheritance syntax
- Multiple inheritance and method resolution order
- https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection
Supports
- Dependencies as objects another object depends on
- Constructor injection of dependencies
- Separation of service registration from service use
- https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices
Supports
- Tests focused on behavior rather than implementation
- Testing private behavior through public-facing methods
- Isolated test doubles for explicit collaborators
- Arrange, act, and assert test structure
- https://github.com/sindresorhus/awesome
Supports
- Discovery of the curated Software Architecture list
- https://github.com/simonaronsson/awesome-software-architecture
Supports
- Discovery of PlantUML
- Discovery of draw.io
- Discovery of Visual Paradigm
- Relevance of the selected projects as software-modeling tools
- https://plantuml.com/class-diagram
Supports
- Text-based class-diagram generation
- Classes, attributes, methods, and visibility
- Extension, implementation, composition, aggregation, and dependency notation
- PlantUML Awesome Link rationale
- https://www.drawio.com/docs/diagram-types/uml/class-diagrams/
Supports
- UML class-diagram shape libraries and templates
- Class attributes, methods, visibility, and scope notation
- Relationship connectors and multiplicity labels
- Rough and detailed modeling workflows
- draw.io Awesome Link rationale
- https://www.visual-paradigm.com/guide/uml-unified-modeling-language/what-is-class-diagram/
Supports
- Class names, attributes, operations, and visibility
- Association, aggregation, composition, inheritance, and multiplicity
- Availability of a free Community Edition
- Visual Paradigm Awesome Link rationale
- https://www.computerhistory.org/timeline/software-languages/
Supports
- 1965 Simula milestone in the OOP timeline
- https://sigplan-pages.sigplan.hosting.acm.org/OpenTOC/hopl20.html
Supports
- Smalltalk-72 through Smalltalk-80 evolution in the OOP timeline
- https://isocpp.org/files/papers/P3650R0.pdf
Supports
- 1985 C++ milestone in the OOP timeline
- https://www.oopsla.org.splashcon.hosting.acm.org/oopsla-history/
Supports
- 1986 first OOPSLA conference and late-1990s mainstream adoption
- https://education.oracle.com/file/general/4955_BriefHistoryOfJava_7.pdf
Supports
- 1995 Java debut in the OOP timeline
- https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/introduction
Supports
- July 2000 first widely distributed C# implementation
- https://www.python.org/download/releases/2.2/
Supports
- 2001 Python 2.2 type and class unification milestone
- https://www.jetbrains.com/idea/
Supports
- IntelliJ IDEA placement in the OOP tooling landscape
- https://www.microsoft.com/licensing/guidance/Visual-Studio
Supports
- Visual Studio placement and licensing in the OOP tooling landscape
- https://eclipseide.org/
Supports
- Eclipse IDE placement and EPL 2.0 licensing in the OOP tooling landscape
- https://github.com/plantuml/plantuml/blob/master/LICENSES.md
Supports
- PlantUML placement and licensing in the OOP tooling landscape
- https://circle.visual-paradigm.com/docs/introduction-and-system-requirements/introduction-of-visual-paradigm/visual-paradigm-editions/
Supports
- Visual Paradigm placement and editions in the OOP tooling landscape
- https://martinfowler.com/bliki/ObjectsAndIteration.html
Supports
- Field Note on growing object design through iteration
- https://www.martinfowler.com/articles/injection.html
Supports
- Field Note on separating configuration from object use
- https://refactoring.guru/design-patterns/bridge
Supports
- Field Note on independent variation axes and composition
