Object-Oriented Software Engineering Concepts and Techniques

Chapter 1: Software Life Cycle

The software life cycle refers to all phases of a software product, from its planning and development to its use and eventual obsolescence. It is often segmented into several main pieces and helps developers and others understand how a product is created, implemented, and used.

Waterfall Model

This is the traditional approach to software engineering. The process follows these steps:

  1. Develop requirements
  2. Design
  3. Programming
  4. Testing
  5. Deployment
  6. Finished

Evolutionary Model

This model acknowledges that software development is iterative and accommodates changes throughout the life cycle. It includes:

  • Corrective projects: Fixing defects
  • Adaptive projects: Changing the system in response to environmental changes
  • Enhancement projects: Adding new features for users
  • Re-engineering or perfective projects: Improving internal structure and maintainability without significant user-facing changes

Greenfield Development

This approach involves developing an entirely new software system from scratch. While it requires significant effort, it offers greater freedom and creativity in design.

Projects building on existing frameworks or components fall between evolutionary and new development. It’s crucial to prevent products from becoming “victims of their own success” by constantly adding features, which can lead to complexity and maintainability issues.

Chapter 2: Object-Oriented Concepts

Inheritance

Inheritance allows a subclass to implicitly inherit features (variables and methods) from a superclass. This relationship is often described using the “is-a” rule (e.g., a car “is a” vehicle).

Abstraction

Abstraction simplifies complex systems by hiding unnecessary details. Key aspects include:

  • Procedural abstraction: Hiding implementation details of methods
  • Data abstraction: Representing data in a simplified way
  • Objects: Abstractions of real-world entities relevant to the program
  • Classes: Abstractions of sets of objects with common characteristics
  • Superclasses: Abstractions of sets of subclasses
  • Operations: Abstractions of sets of methods with similar functionality
  • Attributes and associations: Abstractions of underlying data structures

Modularity

Modularity involves dividing a software system into smaller, manageable units called modules (classes in OOP). Each module focuses on a specific aspect of functionality, improving organization and maintainability.

Encapsulation

Encapsulation protects the internal workings of a class by bundling data and methods together and controlling access through a well-defined interface. This promotes information hiding and reduces dependencies between modules.

Interface

An interface defines a contract that specifies methods a class must implement. It cannot have instance variables or concrete methods. A class can implement multiple interfaces but inherit from only one superclass. The relationship between a class and an interface is often described as “can-be-seen-as” (e.g., a list “can be seen as” a collection).

Exception Handling

Exceptions are unexpected events that disrupt normal program flow. The “try-catch” mechanism allows developers to handle exceptions gracefully, preventing program crashes.

Polymorphism

Polymorphism allows objects of different classes to be treated as objects of a common superclass. This enables code reuse and flexibility.

Dynamic Binding

Dynamic binding (late binding) determines the specific method to be called at runtime based on the object’s type. This supports polymorphism and dynamic behavior.

Instance vs. Abstract Classes

  • Instance classes: Concrete classes that can be instantiated (create objects) and have concrete methods.
  • Abstract classes: Cannot be instantiated and may contain abstract methods (methods without implementation) that subclasses must provide.

Casting

Casting allows changing the type of a variable temporarily. Java’s strict type system requires explicit casting when necessary.

Chapter 3: Frameworks and Client-Server Architecture

Framework

A framework is reusable software that provides a generic solution to a common problem. It consists of a library of classes with hooks and slots for customization.

  • Horizontal frameworks: Provide general-purpose functionality usable by a wide range of applications.
  • Vertical frameworks: Offer more specialized solutions tailored to specific application domains.

Library

A library is a collection of related classes that provide reusable functionality.

Product Line

A product line is a set of related products built on a common technological base. Products within a product line share core features but have variations to address specific market needs.

Slots and Hooks

  • Slots: Mandatory parts of a framework that developers must fill in to adapt it to their specific needs. More slots generally mean greater flexibility.
  • Hooks: Optional points in a framework where developers can add custom functionality.

Client-Server Architecture

Client-server architecture divides a system into two main parts:

  • Client: A program that requests services from a server.
  • Server: A program that provides services to clients.

Advantages of client-server architecture:

  • Distributed workload
  • Remote access to functionality
  • Simplified design through separation of concerns
  • Centralized data management

Fat Client vs. Thin Client

  • Fat client: Performs most processing on the client-side, reducing server load but potentially increasing client complexity.
  • Thin client: Relies heavily on the server for processing, simplifying client implementation but potentially increasing server load.

API (Application Programming Interface)

An API defines the set of services (methods and classes) that a framework or library provides to other software components.

TCP (Transmission Control Protocol)

TCP ensures reliable communication between computers over a network by providing error checking and data flow control.

Sockets

Sockets are endpoints of a communication channel between two programs on a network. They are associated with a port number to identify the specific application.

OCSF (Object Client-Server Framework)

OCSF is a framework for developing client-server systems in Java. It provides abstract classes for clients and servers, allowing developers to extend and customize them through slots and hooks.

IP Protocol (Internet Protocol)

IP handles the routing of data packets between computers on a network.

Chapter 5: UML (Unified Modeling Language)

UML Class Diagrams

UML class diagrams visually represent the structure of an object-oriented system. Key elements include:

  • Classes: Represent types of data
  • Associations: Show relationships between classes
  • Attributes: Represent data associated with classes and objects
  • Operations: Represent functions performed by objects
  • Generalization: Depicts inheritance relationships between classes

Attributes

Attributes store data values associated with classes and objects.

Associations

Associations represent relationships between classes, indicating how objects of those classes interact.

Generalization

Generalization represents the “is-a” relationship between classes, forming inheritance hierarchies.

Association Classes

Association classes represent relationships between classes as separate classes, allowing them to have attributes and operations.

Multiplicity

Multiplicity specifies the number of objects that can participate in an association.

Directionality

: Associations are by default bi-directional. Making associations unidirectional can improve efficiency and reduce complexity, but might also limit the flexibility of the system. Object diagram: shows an example configuration of objects and links that may exist at a particular point during execution of a program. Examples of object diagram: When you show an object diagram generated by an association, you show instances of both classes joined by that association. On the other hand, when you show an object diagram generated by an inheritance hierarchy, you show a single instance of one of its concrete classes. That single instance will contain values of the attributes defined in its class, as well as those attributes inherited from superclasses. In other words, an instance of any class should also be considered to be an instance of each of that class’s superclasses.