SEN 301: Object-Oriented Analysis and Design - Analysis, Design, and Object Orientation

Fundamentals of Software Analysis and Design

Core Concepts of Analysis vs. Design

  • Analysis: The systematic study of a problem domain to gather and define requirements. It establishes what the software system must accomplish, what it must not do, and what specific views each user category accesses.
    • Scope & Transformation: Analysis transforms an ambiguous problem statement (e.g., "Build a course registration system") into a structured understanding of system functionality, preventing redundant or duplicate features.
    • Tool Independence: Analysis involves no programming languages (e.g., Java, C++, C#), software tools, or computing techniques. It is strictly domain-focused.
  • Software Design: The process of defining the overall architecture, components, interfaces, and data structures necessary to satisfy the requirements identified during analysis. It answers how the system will implement the required capabilities.
    • Analogy: If analysis provides raw materials and specifies a requested fashion style (e.g., a polo shirt with contrasting sleeve colors), design determines the precise construction, patterns, and assembly methods to create the garment.
    • Computing Techniques: Design introduces data structures (e.g., arrays, vectors, stacks, linked lists), software architecture patterns, and algorithmic mechanisms.
  • Software Development Life Cycle Order:     Problem→Requirements→Analysis→Design→Implementation\text{Problem} \rightarrow \text{Requirements} \rightarrow \text{Analysis} \rightarrow \text{Design} \rightarrow \text{Implementation}
    • Design serves as the explicit bridge between domain analysis and source code implementation.
    • Class structures defined during design directly dictate coded classes (e.g., five design classes map to five implementation classes).
    • Design cannot correct or capture requirements missed during analysis; requirement defects identified during design necessitate returning to the analysis phase.
  • Key Design Considerations:
    • Class & Responsibility Assignment: Determining required classes and allocating functional obligations (methods) to Student, Course, and Registration.
    • Object Communication: Defining message-passing mechanisms between objects.
    • Storage Selection: Evaluating appropriate data structures (e.g., choosing between vectors, arrays, or linked lists for storing active registrations).
    • Exception & Failure Handling: Establishing rules for incomplete operations (e.g., network disconnects mid-registration and automated transaction recovery or submission).
    • Architecture Patterns: Deciding between client-server, web-based, hierarchical, or distributed software topologies.
    • Decoupling & Interfaces: Designing systems dependent on abstract interfaces rather than concrete implementations (e.g., payment subsystems requiring an amount and proof of payment rather than binding to a specific bank implementation, reflecting dependency inversion principles).

Comparative Matrix: Analysis vs. Design

  • Problem Domain vs. Solution Space:
    • Analysis: Studies and understands the problem domain.
    • Design: Develops the technical solution in software.
  • Requirements Handling:
    • Analysis: Discovers and defines functional and non-functional requirements.
    • Design: Specifies how each identified requirement is realized in software.
  • Primary Focus:
    • Analysis: High-level domain logic and constraints.
    • Design: Software components, data structures, and architecture.
  • Conceptual Representation:
    • Analysis: Identifies real-world concepts and domain entities.
    • Design: Represents domain concepts as software classes, interfaces, and component structures.
  • Behavioral Modeling:
    • Analysis: Identifies required system behaviors and domain rules.
    • Design: Defines object responsibilities, method signatures, and execution workflows.
  • Core Question:
    • Analysis: Asks What the system needs to do.
    • Design: Asks How the system will execute it.

Domain Analysis: University Course Registration System

User Role Identification and Access Boundaries

  • Student: Registers for eligible courses, drops courses, and views academic results. Access to results is strictly read-only. Students cannot modify or award their own grades.
  • Academic Advisor: Reviews, verifies, and approves student course selections.
  • Lecturer: Submits student grades at the end of an academic semester. Once grades are submitted and locked, lecturers cannot edit them. Subsequent grade disputes or modifications are handled exclusively by the registry.
  • Administrator (Registry): Manages system-wide data at the back end across all administrative tiers. Responsibilities include course catalog administration, global grade locks, and handling student registration anomalies (e.g., adding omitted courses post-submission).

Core Domain Concepts

  • Student Eligibility: Defined by holding a valid Babcock University (BU) matriculation number. Individuals without a valid matriculation number cannot access student features on the platform.
  • Departmental Mapping: Courses are mapped strictly to specific academic departments to maintain boundary isolation (e.g., Software Engineering students do not see Nursing or Medicine courses in their registration catalog).
  • Semester Structuring: Divided into discrete terms denoted by session codes:
    • First Semester notation: 2026/2027.1 (where .1 designates the first semester).
    • Second Semester notation: .2.
    • Summer Session notation: .3.
  • Unit Load Regulations: Enforces institutional minimum and maximum credit thresholds per semester, establishing formal boundaries for overload and underload registrations.
  • Domain Rules:
    • Students cannot exceed maximum credit unit caps.
    • Second-semester courses cannot be registered during the first semester.
    • Students are restricted from altering grade records.
  • Domain Behavior: The contextual meaning of domain events. For example, a portal checklist returning "no" signals a missing prerequisite or result issue, whereas "yes" indicates successful verification.
  • Multiplicity: Defines cardinalities between domain entities:
    • A single student registers for multiple courses ( cardinality: 1 to N1 \text{ to } N ).
    • A single lecturer teaches multiple course sections and student groups.

The Analysis Flowchart Sequence

  1. Understand the Problem: Gain a comprehensive view of the problem space.
  2. Identify Requirements: Define the exact capabilities required for a fully functional system.
  3. Identify Domain Concepts: Extract core domain objects (e.g., Student, Course, Registration).
  4. Understand Object Behavior: Map the interactions, constraints, and dynamic behaviors among those concepts.

Object-Oriented Fundamentals and Object Characteristics

Principles of Object Orientation

  • Definition: Object-oriented development organizes software around discrete objects representing real-world physical entities, abstract concepts, or domain responsibilities.
  • Tangibility of Abstract Concepts:
    • Physical objects are identified by physical attributes (e.g., a chair is distinguished from a stool by possessing a backrest).
    • Abstract concepts (e.g., a Course) become software objects by defining explicit attributes and state properties:
      • Course Code (e.g., SEN 301)
      • Course Title
      • Credit Unit
      • Course Category: Compulsory, Elective, or General Studies (GDS).
  • Compulsory Course Rules: Designated with a 'C' on registration forms. Passing all compulsory courses with a minimum grade of 'C' is a non-negotiable graduation requirement.
  • Decoupling Entities vs. Attributes: A lecturer's name is not an attribute of Course because instructor assignments change. Instead, Lecturer is modeled as a distinct class connected to Course via a relationship (e.g., teaches or takes).
  • Class vs. Instance: A class represents the blueprint or set of all domain items (e.g., Course), while individual courses represent instantiated objects of that class.

Modeling a Student Object

  • State Information (What an object knows):
    • Name
    • Matriculation Number: Primary unique identifier across institutional systems (including academic tracking, chapel, and Sabbath worship).
    • Level: Academic standing. Note that level cannot reliably be parsed from matriculation numbers due to direct entry students possessing distinct numbering formats relative to their assigned level.
    • Department: Determines eligible course mappings.
    • Domain Relevance Boundary: Models must capture only attributes essential to system operations. Personal traits such as height, hair color, or complexion must be excluded.
  • Behavior (What an object can do):
    • registerCourse()
    • addCourse()
    • dropCourse()
    • viewResults()

The Three Essential Characteristics of an Object

  1. State:
    • Comprises the attributes and their associated values at any given point in time.
    • State is dynamic and mutates throughout the object lifecycle (e.g., a student's level increases each academic session).
  2. Behavior:
    • Defines the operational actions an object can perform or undergo.
    • Represented by methods in programming languages.
    • Syntactically denoted with trailing parentheses and parameter lists (e.g., dropCourse()), distinguishing them from attributes.
  3. Identity:
    • The property that distinguishes each individual object instance from all other instances, even if two instances share identical state values (e.g., two distinct students named "Alice" of the same age).
    • Identity remains fixed and is anchored by a unique attribute (e.g., matricNumber), operating like a primary key in database systems.

Standard UML Class Diagram Representation

  • A class is modeled in UML as a single rectangular box divided into three vertical compartments:
    • Top Compartment: Class Name (e.g., Student).
    • Middle Compartment: Class Attributes (Properties, with unique identifiers listed first, e.g., matricNumber, name, level, department).
    • Bottom Compartment: Class Operations / Methods (e.g., registerCourse(), dropCourse(), viewResults()).

Paradigm Comparison: Procedural vs. Object-Oriented

Structural and Paradigm Differences

  • Procedural Paradigm:
    • Organizes software around step-by-step operations and sequential routines (e.g., registerStudent(), registerCourse()).
    • Data and functions are strictly decoupled; procedures process input data, modify state, and pass data forward to subsequent procedures.
    • Shared Data Vulnerability: Global or shared variables can be modified by any procedure in the execution chain, causing cascading state side-effects.
      • Execution Example: A variable X=5X = 5 is mutated by Procedure 1 to X=15X = 15. Procedure 2 reads 1515 and doubles it to X=30X = 30. Procedure 3 then receives X=30X = 30. Any function in the chain can compromise data integrity relied upon by others.
  • Object-Oriented Paradigm:
    • Organizes software around unified entities binding state data and behavior into single encapsulated units.
    • Encapsulation (Information Hiding): Prevents external routines from directly mutating internal object data. Access is restricted to explicit public methods and private attribute modifiers.
    • Programs function as networks of autonomous objects interacting via message passing.

Parameter Passing Mechanics

  • Pass by Value:
    • Passes a copy of the argument data to the called function.
    • Changes made to the parameter within the function body do not affect the caller's original variable.
  • Pass by Reference:
    • Passes a direct reference/memory address of the caller's variable to the function.
    • Mutations within the function directly modify the caller's original data.
  • Language Specifics (Java): Java operates strictly using pass-by-value (passing copies of primitive values or copies of object references). Object data protection in Java is achieved through encapsulation (private fields) rather than parameter-passing mechanics.

Detailed Comparison Table

DimensionProcedural ParadigmObject-Oriented Paradigm
Primary FocusSequential actions and functionsAutonomous entities and domain objects
Data & FunctionsStored and managed separatelyBound together into single units (Encapsulation)
Data AccessOpen, shared, and globally exposedRestricted via public and private class interfaces
Program StructureLinear sequence of procedural callsInterconnected network of collaborating objects
Code ReusabilityRoutine copying or shared function librariesInheritance hierarchies and polymorphic behavior
Impact of ChangesData structure changes ripple across functionsStructural changes are localized within specific classes
Domain ModelingModels procedural steps of a workflowModels real-world entities, attributes, and relationships

Clarifying Inheritance and Polymorphism

  • Inheritance: A structural relationship where a subclass derives attributes and behaviors from a generalized superclass and extends or specializes them.
    • Hierarchy Structure: A Car and a Lorry both inherit independently from a generalized superclass Vehicle. A Car does not inherit from a Lorry.
    • Attribute Configuration vs. Polymorphism: Distinct property values (such as varying door or wheel counts) represent simple inheritance and attribute assignment, not polymorphism.
  • Polymorphism: The mechanism allowing different object classes to respond to the exact same method signature in class-specific ways.
    • Execution: Calling drive() on a Vehicle variable at runtime executes Car.drive() if the underlying instance is a Car, or Lorry.drive() if the instance is a Lorry.

Domain Modeling and Class Design Specifications

Domain Scope and Boundary Guidelines

  • Scope Determination: System boundaries must be established before class design commences (e.g., determining whether a university platform includes housing, dining, payment processing, or exclusively academic administration).
  • Comprehensive Entity Mapping: Avoid narrowing focus exclusively to academic workflows; operational domains require non-academic staff, registry, bursary, departmental officers, and security entities.
  • Redundancy Prevention: Merge overlapping user groups into base classes with role specializations (e.g., creating a base Staff class split into Academic and NonAcademic subcategories, with executive positions like Vice-Chancellor or Registrar spanning administrative domains).

Structural Class Specifications: Course Registration System

Student Class Specification
  • Attributes:
    • studentID: String (Unique identifier; context-specific, distinct from medical record IDs in clinic systems).
    • name: String
    • email: String
  • Methods:
    • viewCourses(): Displays available courses for registration.
    • registerForCourse(course): Initiates course registration.
    • viewRegistration(): Returns current registered course status.
Course Class Specification
  • Attributes:
    • courseID: String
    • title: String
    • creditUnit: Integer
  • Methods:
    • getDetails(): Returns course metadata.
    • getEnrolledStudents(): Returns student roster for the course.
    • isFull(): Boolean query evaluating whether current student enrollment has met or exceeded total class capacity.
Registration Class Specification (Association Class)
  • Attributes:
    • student: Reference to Student object.
    • course: Reference to Course object.
    • date: Date timestamp.
    • status: Registration state (e.g., Fully Registered, Pending Approval).
  • Methods:
    • confirm(): Finalizes registration relationship.
    • cancel(): Rescinds registration relationship.
    • getDetails(): Returns full registration entry details.
  • UML Modeling Mechanics:
    • Registration is an Association Class; it cannot exist independently as it reifies the operational relationship between a specific Student and a specific Course.
    • In UML modeling, an association class is represented as a class box attached via a dashed line to the solid association line connecting the Student and Course classes.