Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk5 min

Modelling the Real World with Object-Oriented Programming

Object-oriented programming represents a domain through purposeful abstractions: classes describe kinds of objects, while objects hold state, relationships and relevant behavior.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Object-oriented programming models a real-world domain by selecting the concepts, relationships, state and behavior that matter to a particular software purpose. A class describes a set of possible objects; an object is one individual with its own state and relationships. The model is useful precisely because it leaves out details that the software does not need.

What does it mean to model the real world?

A model is a representation of a system in a domain of interest, not a miniature copy of everything that exists there. The Object Management Group’s UML 2.5 specification describes a model as making statements about a system while abstracting from details, from a particular point of view and for a particular purpose. That purpose should guide what the software represents.

For example, a library system might need to represent books, borrowers, loans and due dates. It may not need to represent a book’s paper weight or the color of a borrower’s shoes. Those facts are real, but they do not help answer the system’s relevant questions. What belongs in the model depends on what the application must do.

This is why modelling begins with questions and requirements, not with an attempt to list every thing in the domain. Ask what the software must know, decide or change. Then identify the concepts and distinctions needed to support those tasks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How classes and objects represent domain concepts

A class describes a kind of thing

In UML, a classifier describes a set of objects. A class is a familiar kind of classifier: it defines the properties and operations that apply to instances of that class. In a library example, a Book class might describe properties such as a title and catalogue identifier, along with operations relevant to the application.

An object is one individual

An object is an individual instance with a state and relationships to other objects. Its state is expressed through values of its properties. One particular book might have the title “The Left Hand of Darkness” and be linked to a loan record; another object described by the same class could have a different title and no current loan.

The distinction is useful: a class describes what members of a kind have in common, while an object represents a particular member at a particular time. A class is not the real-world thing itself; it is part of the software’s chosen representation of that thing.

Relationships connect the model

Domain objects often matter because of how they are connected. A borrower may have loans; a loan may refer to a book and include a due date. Such links make it possible to represent meaningful facts about the domain rather than a disconnected collection of records.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Include behavior as well as data

A useful domain model is not only a set of data fields. Martin Fowler describes a domain model as an object model of a domain that incorporates both behavior and data, with interconnected objects representing meaningful individuals. The concepts can appear at different scales: a model might represent a corporation, its departments and people, or something as small as a line on an order form.

Behavior describes what the system can do with or through its objects. For a loan, behavior might include checking whether it can be renewed or recording its return. Keeping relevant behavior close to the concepts it concerns can clarify responsibilities: a reader can see not only what information the model holds, but also what actions belong to it.

Not every action must be assigned to an individual domain object, and object-oriented design can use other structures too. The point is to make the model’s responsibilities intelligible and aligned with the software’s purpose.

Why not make every noun a class?

A noun in a requirements document is a candidate for modelling, not an automatic class. A concept deserves a distinct representation when its identity, state, relationships or behavior matters to the system’s purpose. This is a practical design inference from purpose-driven abstraction, not a formal UML rule.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Suppose a shop application mentions customers’ favorite colors. If the application only needs to print shipping labels, favorite color may not belong in its model. If it recommends clothing, that preference may become relevant state. The same real-world fact can be useful in one model and irrelevant in another.

Likewise, avoid adding classes simply because a domain contains many named things. Extra distinctions can make implementation harder without helping the software answer its required questions. A strong model is selective, but it should not omit distinctions the application relies on.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When UML helps explain an object-oriented model

The Object Management Group says UML helps users “specify, visualize, and document models of software systems, including their structure and design, in a way that meets all of these requirements.” UML is a language for communicating and specifying models; it is not a requirement that every object-oriented design be drawn in UML. Although its concepts such as classes and operations fit naturally with object-oriented languages, OMG also notes that UML can model applications that are not object-oriented.

Choose a diagram according to the question readers or developers need to answer:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Class diagrams show types and structural relationships, helping explain the model’s general shape.
  • Object diagrams show a snapshot of particular instances and links, making concrete example states easier to inspect.
  • Behavioral views are useful when interaction, activity or changes of state are the central concern.

These are different views of a model, not competing definitions of it. A class diagram can show that a borrower may have loans; an object diagram can show one borrower linked to a particular loan; a behavioral view can show how a loan changes when returned.

How to judge two possible models

When two designs represent the same scenario, compare them against the software’s stated purpose rather than against an imagined perfect copy of reality. Useful questions include:

  • Does each model support the required questions and actions?
  • Are the responsibilities of objects and their relationships clear?
  • Can the design accommodate changes that are relevant to the domain?
  • Does the added structure justify the implementation complexity it brings?

These are practical evaluation criteria, not a published scoring system. A more detailed model is not automatically better: its value depends on whether the added distinctions help meet the requirements.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.