How unit 1 is examined
This unit reviews the object-oriented paradigm, the basic OO concepts (object, the four design principles, inheritance) and the SDLC; Basic Concepts carries the most marks, and every past question is a 7-mark "explain" or "compare".
The Object Oriented Paradigm
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. <mark>The object-oriented paradigm models software as a set of interacting objects, each bundling data with the operations on that data, built from classes and organised using encapsulation, inheritance and polymorphism.</mark>
Key points.
- Significance: the system is split into self-contained objects, so it is modular and a change stays local to one class.
- Classes and inheritance let existing code be reused instead of rewritten, which cuts development effort.
- Encapsulation hides data behind methods, so the software is easier to maintain and safer to modify.
- Real-world entities map directly to objects, so analysis, design and code use the same vocabulary.
- Procedural programming is top-down and function-centred, with data shared globally; OO is object-centred, with data owned by objects.
- Polymorphism lets one interface serve many forms, for example
area()behaves differently forCircleandRectangle, so new types are added without changing calling code. - The four pillars are abstraction, encapsulation, inheritance and polymorphism; a paradigm is judged by how well it supports all four.
- Because objects are independent, teams can develop them in parallel and test each in isolation, which lowers the cost of large projects.
| Basis | Procedural | Object oriented |
|---|---|---|
| Unit of program | Functions (procedures) | Objects and classes |
| Focus | Steps to perform | Data and its behaviour |
| Data | Global, shared, exposed | Encapsulated, private to the object |
| Design approach | Top-down | Bottom-up, object-centric |
| Reuse | Copy or call functions | Inheritance and composition |
| Security | Weak, data open to all functions | Strong, access specifiers |
| Example | C: withdraw(acc, amt) |
Java: acc.withdraw(amt) on a Account object |
Answer frame. Open with the definition; give significance (points 1-4, 6, 8); draw the comparison table; close with a bank example, withdraw(acc, amt) in C versus acc.withdraw(amt) in an Account class.
Asked: [7 marks] (Jun 2025) What is the object-oriented paradigm? Discuss its significance in software development and how it differs from procedural programming approaches?
Basic Concepts
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. <mark>An object is a real-world entity that has identity, state and behaviour; a class is the blueprint from which objects are created.</mark>
Key points.
- Identity makes each object distinct even when its state is equal to another's; state is the values of its attributes; behaviour is the operations it performs.
- Example: class
Car; objectmyCarhas identity (its own reference), state (colour = red, speed = 40) and behaviour (accelerate(),brake()). - Abstraction shows only the essential features of an object and ignores irrelevant detail, defining its outside view.
- Encapsulation binds data and methods in one class and hides the data using private access, exposing only public methods.
- Modularity divides a system into cohesive, loosely coupled classes or modules that can be built and changed separately.
- Hierarchy is a ranking of abstractions: "is-a" (inheritance) and "part-of" (aggregation).
- Inheritance lets a child class acquire the properties and methods of a parent class, so common code is written once and reused; the child adds or overrides behaviour.
Diagram. Types of inheritance.
<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u1-01" viewBox="0 0 1115 130" width="1115" height="130" role="img" aria-label="Types of inheritance (A is the parent class)"><style>#dsfig-u1-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u1-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u1-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u1-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u1-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u1-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u1-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u1-01 .t{fill:#16181D;font-weight:500}#dsfig-u1-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u1-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u1-01 .dot{fill:#16181D}#dsfig-u1-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u1-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u1-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u1-01 .ah{fill:#454C5A}#dsfig-u1-01 .ah.hi{fill:#2340B8}#dsfig-u1-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u1-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u1-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u1-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u1-01 .e{stroke:#B1B7C3}html.dark #dsfig-u1-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u1-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u1-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u1-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u1-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u1-01 .t{fill:#E6E8ED}html.dark #dsfig-u1-01 .t.inv{fill:#0F1115}html.dark #dsfig-u1-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u1-01 .dot{fill:#E6E8ED}html.dark #dsfig-u1-01 .ann{fill:#8FA3FF}html.dark #dsfig-u1-01 .lbl{fill:#858D9C}html.dark #dsfig-u1-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u1-01 .ah{fill:#B1B7C3}html.dark #dsfig-u1-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u1-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u1-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u1-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><line class="e" x1="537.8" y1="37" x2="86.5" y2="101"/><line class="e" x1="537.8" y1="37" x2="290.5" y2="101"/><line class="e" x1="537.8" y1="37" x2="541.5" y2="101"/><line class="e" x1="537.8" y1="37" x2="781" y2="101"/><line class="e" x1="537.8" y1="37" x2="989" y2="101"/><rect class="n" x="461.3" y="22" width="153" height="30" rx="8"/><text class="t" x="537.8" y="37" dy=".35em" text-anchor="middle">Inheritance types</text><rect class="n" x="14" y="86" width="145" height="30" rx="8"/><text class="t" x="86.5" y="101" dy=".35em" text-anchor="middle">Single: B from A</text><rect class="n" x="175" y="86" width="231" height="30" rx="8"/><text class="t" x="290.5" y="101" dy=".35em" text-anchor="middle">Multilevel: C from B from A</text><rect class="n" x="422" y="86" width="239" height="30" rx="8"/><text class="t" x="541.5" y="101" dy=".35em" text-anchor="middle">Hierarchical: B and C from A</text><rect class="n" x="677" y="86" width="208" height="30" rx="8"/><text class="t" x="781" y="101" dy=".35em" text-anchor="middle">Multiple: C from A and B</text><rect class="n" x="901" y="86" width="176" height="30" rx="8"/><text class="t" x="989" y="101" dy=".35em" text-anchor="middle">Hybrid: mix of types</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Types of inheritance (A is the parent class)</figcaption></figure>
Polymorphism and reuse. Inheritance promotes reusability because the parent's code is written, tested and debugged once and every child gets it free; a bug fixed in the parent is fixed in all children, and a child overrides only what differs, so total code shrinks and consistency grows. The hierarchy also models real "is-a" relations: Dog is an Animal, SavingsAccount is an Account.
Object versus class. A class is a template defined once at design time and holds no data of its own; objects are its run-time instances, and many objects come from one class. Car myCar = new Car(); creates an object; myCar and yourCar share behaviour but have separate state and identity.
Types. Single has one parent and one child; multilevel is a chain (grandparent, parent, child); hierarchical has many children of one parent; multiple has one child with two or more parents (Java allows it only through interfaces); hybrid combines two or more of these.
class Animal { void eat() { } }
class Dog extends Animal { void bark() { } } // single: Dog reuses eat()
class Puppy extends Dog { void play() { } } // multilevel: Puppy has eat(), bark()
class Cat extends Animal { void meow() { } } // hierarchical: Dog and Cat share Animal
| Type | Parents : children | Example |
|---|---|---|
| Single | 1 : 1 | Dog from Animal |
| Multilevel | chain of levels | Puppy from Dog from Animal |
| Hierarchical | 1 : many | Dog, Cat from Animal |
| Multiple | many : 1 | Teaching Assistant from Student and Employee |
| Hybrid | mixed | Student, Employee from Person, then TA from both |
The diamond problem arises in multiple and hybrid inheritance when a child inherits the same member through two paths; C++ solves it with virtual base classes and Java by allowing multiple inheritance only of interfaces.
Answer frame. For the object question, define object, give the Car example, then explain the four principles in the order abstraction, encapsulation, modularity, hierarchy. For the inheritance question, define it, explain reuse (points 7), draw the types diagram with one example each, and close with the benefit of less duplication.
Pitfall: Do not confuse abstraction (outside view, what) with encapsulation (hiding inside, how).
Asked: [7 marks] (May 2022) What is a object? What are the principles of a object oriented design, explain? Asked: [7 marks] (Jun 2025) Explain the concept of inheritance in OOP. How does it promote code reusability and what are the different types of inheritance (single, multiple, hierarchical, etc.)? Provide examples to illustrate your points.
Software Development Life Cycle and Model Architectures
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. <mark>The Software Development Life Cycle (SDLC) is the structured sequence of phases followed to plan, build, test, deliver and maintain software.</mark>
Key points.
- Need: it gives a disciplined process, so cost, time and quality are controlled and the work is predictable.
- Requirement analysis collects and documents what the user wants, so the right product is built.
- Design turns requirements into architecture and detailed design, which guides coding and catches flaws early.
- Implementation writes the code from the design; testing then finds defects and checks the requirements are met.
- Deployment releases the product to users; maintenance fixes faults and adds changes afterwards, keeping it useful.
- Each phase produces a deliverable (SRS, design document, source code, test report, release), and each is reviewed before the next begins, so errors are caught while they are cheap to fix.
- Following the phases in order links every activity to a user need, which is how the SDLC delivers a quality product on time and within budget.
Diagram. SDLC phases (waterfall order).
<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u1-02" viewBox="0 0 596 80" width="596" height="80" role="img" aria-label="Req = requirements, Des = design, Imp = implementation, Tst = testing, Dep = deployment, Mnt = maintenance"><style>#dsfig-u1-02 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u1-02 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u1-02 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u1-02 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u1-02 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u1-02 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u1-02 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u1-02 .t{fill:#16181D;font-weight:500}#dsfig-u1-02 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u1-02 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u1-02 .dot{fill:#16181D}#dsfig-u1-02 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u1-02 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u1-02 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u1-02 .ah{fill:#454C5A}#dsfig-u1-02 .ah.hi{fill:#2340B8}#dsfig-u1-02 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u1-02 .wl .t{font-size:12px;font-weight:700}#dsfig-u1-02 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u1-02 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u1-02 .e{stroke:#B1B7C3}html.dark #dsfig-u1-02 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u1-02 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u1-02 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u1-02 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u1-02 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u1-02 .t{fill:#E6E8ED}html.dark #dsfig-u1-02 .t.inv{fill:#0F1115}html.dark #dsfig-u1-02 .kd{stroke:#E6E8ED}html.dark #dsfig-u1-02 .dot{fill:#E6E8ED}html.dark #dsfig-u1-02 .ann{fill:#8FA3FF}html.dark #dsfig-u1-02 .lbl{fill:#858D9C}html.dark #dsfig-u1-02 .ptr{fill:#8FA3FF}html.dark #dsfig-u1-02 .ah{fill:#B1B7C3}html.dark #dsfig-u1-02 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u1-02 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u1-02 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u1-02 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh2" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M59,40 L122.2,40" marker-end="url(#ah2)"/><path class="e" d="M162.2,40 L225.4,40" marker-end="url(#ah2)"/><path class="e" d="M265.4,40 L328.6,40" marker-end="url(#ah2)"/><path class="e" d="M368.6,40 L431.8,40" marker-end="url(#ah2)"/><path class="e" d="M471.8,40 L535,40" marker-end="url(#ah2)"/><circle class="n" cx="40" cy="40" r="18"/><text class="t" x="40" y="40" dy=".35em" text-anchor="middle">Req</text><circle class="n" cx="143.2" cy="40" r="18"/><text class="t" x="143.2" y="40" dy=".35em" text-anchor="middle">Des</text><circle class="n" cx="246.4" cy="40" r="18"/><text class="t" x="246.4" y="40" dy=".35em" text-anchor="middle">Imp</text><circle class="n" cx="349.6" cy="40" r="18"/><text class="t" x="349.6" y="40" dy=".35em" text-anchor="middle">Tst</text><circle class="n" cx="452.8" cy="40" r="18"/><text class="t" x="452.8" y="40" dy=".35em" text-anchor="middle">Dep</text><circle class="n" cx="556" cy="40" r="18"/><text class="t" x="556" y="40" dy=".35em" text-anchor="middle">Mnt</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Req = requirements, Des = design, Imp = implementation, Tst = testing, Dep = deployment, Mnt = maintenance</figcaption></figure>
| Phase | Activity | Output | Contribution to quality |
|---|---|---|---|
| Requirement | Gather and analyse user needs | SRS document | Right product is built |
| Design | Architecture, data and interface design | Design document | Sound structure, fewer defects |
| Implementation | Coding to the design | Source code | Correct, standard code |
| Testing | Verify against requirements | Test report | Defects removed before release |
| Deployment | Install and release | Working system | Users get a usable product |
| Maintenance | Fix, adapt, enhance | Updated releases | Product stays useful and reliable |
Model architectures. The phases can be arranged in different process models: waterfall (strictly sequential, suits fixed requirements), iterative and incremental (deliver in slices), spiral (adds risk analysis to each loop), and agile (short sprints with constant feedback). The choice depends on how stable the requirements and how large the risk are.
Answer frame. Open with the definition and need (points 1, 6, 7); draw the phase diagram; then explain each phase with its significance in the table order; close with the link between disciplined phases and product quality.
Asked: [7 marks] (Jun 2025) What is the Software Development Life Cycle (SDLC), and why is it important in software engineering? Describe the different phases of SDLC and their significance in delivering a quality software product.
Last-minute revision
- Object = identity + state + behaviour; class = blueprint.
- Four design principles: abstraction, encapsulation, modularity, hierarchy.
- Encapsulation hides data behind public methods.
- Hierarchy = is-a (inheritance) and part-of (aggregation).
- Inheritance types: single, multilevel, hierarchical, multiple, hybrid.
- OO is object-centric with encapsulated data; procedural is function-centric with global data.
- SDLC phases: requirement, design, implementation, testing, deployment, maintenance.
- Polymorphism: one interface, many forms; overriding gives run-time behaviour.
- Class is the template, object is the run-time instance; many objects per class.
- Reuse through inheritance: write and test the parent once, children get it free.
- Diamond problem: same member inherited by two paths in multiple inheritance.
- Process models: waterfall, iterative, spiral, agile.
Memory hooks
- AEMH: Abstraction, Encapsulation, Modularity, Hierarchy.
- Object = ISB: Identity, State, Behaviour.
- SDLC: "Really Do Implement Tests, Deploy, Maintain".
Coverage checklist
- The Object Oriented Paradigm: Jun 2025 OO paradigm vs procedural.
- Basic Concepts: May 2022 object and design principles; Jun 2025 inheritance.
- Software Development Life Cycle and Model Architectures: Jun 2025 SDLC phases.