We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59
SE MODULE2
• Introduction, Modelling Concepts and Class Modelling: What is Object
orientation? What is OO development? OO Themes; Evidence for usefulness of OO development; OO modelling history.Modelling as Design technique: Modelling, abstraction, The Three models. Class Modelling: Objectand Class Concept, Link and associations concepts, Generalization and Inheritance, A sample classmodel, Navigation of class models, and UML diagrams What is object orientation • Object orientation in software engineering (SE) is a programming paradigm where software systems are designed, implemented, and organized around the concept of "objects.“
• Objects represent real-world entities or abstract concepts and
encapsulate both data (attributes) and behavior (methods). • Object orientation promotes modularity, reusability, and maintainability by emphasizing concepts such as encapsulation, inheritance, polymorphism, and abstraction.
• It provides a structured approach to software development,
facilitating the creation of complex systems with ease and promoting collaboration among developers. OO Themes • Object-oriented (OO) themes in software engineering (SE) encompass key concepts and principles that guide the design, development, and maintenance of object-oriented software systems Abstraction Encapsulation Combination of data and behavior Sharing Object Essence Synergy Abstraction • Focuses on representing essential characteristics while hiding implementation details. • Enables the creation of simplified models of complex systems, enhancing understandability and maintainability. • Data Abstraction: Represents real-world entities or concepts as objects with well-defined attributes and behaviors. • Data abstraction allows developers to create models that capture the essential properties of objects without exposing their internal implementation. • Procedural Abstraction: Focuses on the specification of operations or methods without revealing the underlying details of how those operations are implemented. • Benefits: • Simplification: Abstraction simplifies the understanding and design of complex systems by focusing on essential aspects and hiding unnecessary details. • Modularity: Encourages modular design and encapsulation, leading to more manageable and maintainable software systems. • Flexibility: Enables developers to create reusable components and design systems that are adaptable to changing requirements. • Example: In a banking application, abstraction can be used to represent a bank account as an object with attributes such as account number, balance, and owner, and methods such as deposit, withdraw, and transfer. • The internal details of how these operations are implemented (e.g., database transactions) are abstracted away, providing a simplified interface for interacting with the account. Encapsulation • Bundles data (attributes) and behaviors (methods) into a single unit (class), hiding internal details. • Promotes information hiding, modularity, and reusability. • Data Hiding: Encapsulation hides the internal representation of an object's data, allowing access only through methods or properties with defined interfaces. • Access Control: Encapsulation enables developers to control access to an object's members (attributes and methods) by specifying their visibility (e.g., public, private, protected). • Benefits: • Information Hiding: Encapsulation shields the internal details of an object from external entities, reducing dependencies and promoting modularity. • Modifiability: By encapsulating data and behavior within a class, encapsulation makes it easier to modify the implementation of an object without affecting other parts of the system. • Security: Encapsulation enhances security by preventing unauthorized access to an object's internal state and ensuring that data integrity is maintained. • Example: In a car simulation program, encapsulation can be used to represent a car as an object with attributes such as speed, fuel level, and engine status, and methods such as accelerate, brake, and refuel. Access to these attributes and methods is restricted to predefined interfaces, ensuring that the car's state is manipulated safely and securely. Combining data and behaviour • Definition: One of the fundamental principles of object-oriented programming (OOP) is the combination of data (attributes) and behavior (methods or functions) into a single unit, known as an object. • This principle is central to the concept of encapsulation, where the internal state of an object is encapsulated along with the methods that operate on that state. • Example: In a banking application, a "BankAccount" class could encapsulate both the account balance (data) and methods for depositing, withdrawing, and transferring funds (behavior). Each instance of the "BankAccount" class represents a specific account with its own balance and associated operations. • Object Essence: • Definition: In object-oriented programming (OOP), an object's essence refers to its fundamental nature or identity, encapsulating both its data (attributes) and behavior (methods). • Example: In a social media application, a "User" object encapsulates attributes such as username, email, and profile picture, along with behaviors like posting, liking, and commenting. • Synergy: • Synergy in OOP refers to the harmonious interaction and collaboration between objects within a software system to achieve common goals. • Example: In an e-commerce platform, objects such as "Product," "ShoppingCart," and "PaymentProcessor" synergize to enable a seamless shopping experience, with the "ShoppingCart" coordinating product selection and the "PaymentProcessor" handling transactions. Sharing • Sharing as an object-oriented theme emphasizes the essence of objects, encapsulating both data and behavior, and the synergy between objects, fostering collaboration and cooperation within software systems. • Objects share their essence by collaborating and interacting with each other, leveraging their individual strengths and capabilities to achieve common objectives. Evidence for the Usefulness of Object-Oriented (OO) Development • Modularity and Reusability: • Modular design breaks down complex systems into smaller, manageable components. • Reusable objects can be employed across different parts of software or in entirely different projects, reducing development time and effort. • Encapsulation and Information Hiding: • Encapsulation bundles data and methods within objects, restricting access to internal data from outside. • Information hiding helps manage complexity and reduces dependencies between different parts of the software, enhancing maintainability. • Inheritance and Code Reuse: • Inheritance facilitates the creation of hierarchies of related classes, allowing objects to inherit attributes and behaviors from parent classes. • Code reuse is promoted, reducing redundancy and improving maintainability. • Polymorphism and Flexibility: • Polymorphism allows objects of different classes to be treated interchangeably, promoting flexibility and adaptability in software design. • Abstraction and Modeling: • Abstraction represents real-world entities as objects with well-defined interfaces and behaviors, making software design more intuitive. • Complex systems are modeled in a natural way, enabling easier understanding, design, and maintenance of software. • Testing and Debugging: • Modular and encapsulated nature facilitates unit testing, integration testing, and debugging. • Each object can be tested independently, leading to higher software quality and reliability. • Scalability and Extensibility: • OO development promotes flexible and extensible software architectures. • Systems can accommodate changes and additions over time, adapting to evolving requirements and technological advancements. 00 Modeling History • 1960s - Emergence of Concepts: • Foundations laid in the 1960s with early concepts in computer science. • Introduction of Simula by Ole-Johan Dahl and Kristen Nygaard, pioneering classes and objects.
• 1970s - Smalltalk and Dynamic Typing:
• Smalltalk, developed by Alan Kay and Adele Goldberg, introduced dynamic typing and message passing. • Smalltalk's impact on OO modeling and software development was significant. • 1980s - Formalization of Techniques: • Formalization of Object-Oriented Analysis and Design (OOAD) methodologies. • Development of Booch method, Objectory method, and Object Modeling Technique (OMT).
• 1990s - Unified Modeling Language (UML):
• UML emerged as a standardized OO modeling language. • Collaboration of Grady Booch, James Rumbaugh, and Ivar Jacobson led to the creation of UML. • UML became the de facto standard for OO modeling, providing comprehensive diagrams and notation. • 2000s - Agile and Iterative Development: • Rise of agile and iterative methodologies like Extreme Programming (XP) and Scrum. • OO modeling adapted to support agile practices, focusing on lightweight techniques and continuous integration. • 2010s - Model-Driven Development (MDD) and Domain-Driven Design (DDD): • Growing interest in Model-Driven Development (MDD) and Domain-Driven Design (DDD). • MDD emphasizes models as primary artifacts in software development. • DDD offers methodologies for modeling complex domains and designing OO systems. • Present and Future: • OO modeling continues to evolve with advancements in software engineering. • Integration with emerging technologies like AI, blockchain, and IoT. • Refinement of agile practices and adaptation to changing development landscapes. The Three models • The Class Model, • State Model, • and Interaction Model They are are essential components used for designing and understanding software systems. The class Model The Class Model is a structural model that represents the static structure of a software system in terms of classes, their attributes, methods, and relationships between classes. The class Model • Classes: Classes represent entities or objects in the system. They encapsulate data (attributes) and behavior (methods). • Attributes: Attributes are properties or characteristics of classes. They describe the state of objects. • Methods: Methods define the behavior or actions that objects can perform. They encapsulate the functionality of the system. • Relationships: Relationships describe how classes are associated or connected to each other. Common relationships include association, aggregation, and inheritance. The class Model • Class diagrams are commonly used to visualize the Class Model. These diagrams depict classes as boxes with attributes and methods, and relationships between classes are represented using lines and arrows. State Model:
• The State Model is a behavioral model that describes the
different states that objects in the system can exist in, as well as the transitions between these states. • States: States represent the conditions or modes in which an object can exist at a given time. Each state corresponds to a particular behavior or set of properties. • Transitions: Transitions describe the events or actions that cause an object to change from one state to another. They specify the conditions under which state changes occur. State Model: • State diagrams (also known as state machines or finite state machines) are commonly used to visualize the State Model. • These diagrams depict states as nodes and transitions as arrows between the nodes, indicating the flow of control within the system. Interaction Model:
• The Interaction Model focuses on how objects collaborate and
interact with each other to accomplish tasks or fulfill requirements. • Interactions: Interactions describe the communication and message passing between objects during runtime. They specify the sequence of actions or events that occur as objects interact with each other.
• Messages: Messages represent the information or requests
exchanged between objects. They trigger actions or behaviors in the receiving objects. • Sequence diagrams and collaboration diagrams (also known as communication diagrams) are commonly used to visualize the Interaction Model. • These diagrams depict the sequence of interactions between objects over time, showing the flow of control and data within the system. • By utilizing these three models, software engineers can effectively design and analyze software systems, ensuring that they meet the desired functionality, behavior, and structural requirements.
• These models provide a systematic approach to software
design, helping to manage complexity and facilitate communication among stakeholders throughout the development process. Class Modelling - Introduction • A class model captures the static structure of a system by characterizing the objects in the system, the relationships between the objects, and the attributes and operations for each class of objects Class Modelling - Introduction Object • The purpose of class modelling is to describe objects. An object is a concept, abstraction, or thing with an identity that has meaning for an application. • Ex. Joe Smith, Infosys Company, process number 7648 and top window are objects Classes • A class describes a group of objects with the same properties(attributes),behavior(operation),kinds of relationships and semantics • Ex Person, Company, Process, and window are classes Class Diagrams • Class diagrams • Graphic notation for modeling classes and their relationship. • Object diagrams • Graphic notation for individual objects and their relationships. VALUES AND ATTRIBUTES • Value :Piece of data • Attribute : named property of a class that describes a value held by each object of the class • Operation • Function or procedure that may be applied to or by objects in a class • All objects in a class share the same operations • Attributes:Name ,bdate,weight • Values: James,21 oct1983,64 (Of person object) Links and Association • Link • Physical or conceptual connection among objects • Eg: Joe Smith Works For Simplex Company • Instance of an association • Association • Group of links with common structure and common semantics • Set of potential links • Eg.a person works For a company • Multiplicity • Constrain the number of related objects • Assign a multiplicity to an association end. • Association end names • Each end of the association can have a name • Convenience for traversing association • Ordering • Indicate an ordered set of objects • Provide an explicit order