Course material from my Object-Oriented Development course.This presentation covers the design phase and focuses on a variety of software design principles.
Course material from my Object-Oriented Development course.This presentation covers the analysis phases and focuses on class discovery, domain modeling, activity diagrams, and sequence diagrams.
The document discusses object modeling for software engineering projects. It covers modeling reality versus models, the types of objects (entity, boundary, control), and the order of activities in object modeling. The key activities in object modeling include identifying classes from use cases, flows of events, and other documentation. Class diagrams are then generated to represent the relationships between these classes.
CS8592 Object Oriented Analysis & Design - UNIT IV pkaviya
This document discusses object-oriented analysis and design patterns. It covers GRASP principles for assigning responsibilities to objects, such as information expert and controller. It also discusses design patterns including creational patterns like factory method and structural patterns like bridge and adapter. The document is focused on teaching object-oriented principles for designing reusable and well-structured code.
The document discusses the differences between analysis modeling and design engineering/modeling. Analysis involves understanding a problem, while design focuses on creating a solution. Models can be used to better understand problems in analysis or solutions in design. The key aspects of design engineering are then outlined, including translating requirements into a software blueprint, iterating on the design, and ensuring quality through guidelines such as modularity, information hiding, and functional independence. Common design concepts like abstraction, architecture, patterns, and classes are also explained.
Software design is a process through which requirements are translated into a ― blueprint for constructing the software.
Initially, the blueprint shows how the software will look and what kind of data or components will be required to in making it.
The software is divided into separately named components, often called ‘MODULES’, that are used to detect problems at ease.
This follows the "DIVIDE AND CONQUER" conclusion. It's easier to solve a complex problem when you break it into manageable pieces.
The document discusses object-oriented analysis and design concepts like refinement, extensibility, and design for reusability. It provides details on different types of extensibility like white-box, black-box, and gray-box extensibility. It also discusses object-oriented database management systems and compares relational databases with object-oriented databases.
Course material from my Object-Oriented Development course.This presentation covers the analysis phases and focuses on class discovery, domain modeling, activity diagrams, and sequence diagrams.
The document discusses object modeling for software engineering projects. It covers modeling reality versus models, the types of objects (entity, boundary, control), and the order of activities in object modeling. The key activities in object modeling include identifying classes from use cases, flows of events, and other documentation. Class diagrams are then generated to represent the relationships between these classes.
CS8592 Object Oriented Analysis & Design - UNIT IV pkaviya
This document discusses object-oriented analysis and design patterns. It covers GRASP principles for assigning responsibilities to objects, such as information expert and controller. It also discusses design patterns including creational patterns like factory method and structural patterns like bridge and adapter. The document is focused on teaching object-oriented principles for designing reusable and well-structured code.
The document discusses the differences between analysis modeling and design engineering/modeling. Analysis involves understanding a problem, while design focuses on creating a solution. Models can be used to better understand problems in analysis or solutions in design. The key aspects of design engineering are then outlined, including translating requirements into a software blueprint, iterating on the design, and ensuring quality through guidelines such as modularity, information hiding, and functional independence. Common design concepts like abstraction, architecture, patterns, and classes are also explained.
Software design is a process through which requirements are translated into a ― blueprint for constructing the software.
Initially, the blueprint shows how the software will look and what kind of data or components will be required to in making it.
The software is divided into separately named components, often called ‘MODULES’, that are used to detect problems at ease.
This follows the "DIVIDE AND CONQUER" conclusion. It's easier to solve a complex problem when you break it into manageable pieces.
The document discusses object-oriented analysis and design concepts like refinement, extensibility, and design for reusability. It provides details on different types of extensibility like white-box, black-box, and gray-box extensibility. It also discusses object-oriented database management systems and compares relational databases with object-oriented databases.
Rumbaugh's Object Modeling Technique (OMT) is an object-oriented analysis and design methodology. It uses three main modeling approaches: object models, dynamic models, and functional models. The object model defines the structure of objects in the system through class diagrams. The dynamic model describes object behavior over time using state diagrams and event flow diagrams. The functional model represents system processes and data flow using data flow diagrams.
The document discusses several design techniques for software development including top-down design, bottom-up design, stepwise refinement, levels of abstraction, structured design, integrated top-down development, and Jackson structured programming. Top-down design starts by identifying major modules and decomposing them into lower level modules. Bottom-up design first identifies primitive objects, actions, and relationships. Stepwise refinement involves decomposing design decisions to elementary levels in small increments.
This summary provides an overview of the key concepts discussed in the document:
1. The document discusses various object-oriented analysis and design concepts including use case modeling, the Unified Modeling Language (UML), activity diagrams, associations, aggregation, and composition.
2. It provides descriptions and examples of these concepts, such as defining use cases, actors, and use case diagrams. Activity diagrams are described as showing workflows and processes.
3. The document also discusses UML notation for modeling associations, including binary and ternary associations, and modeling cardinality ratios between associated classes.
This document contains a chapter from a course manual on Object Oriented Analysis and Design. The chapter discusses the inherent complexity of software systems. It identifies four main reasons for this complexity: 1) the complexity of the problem domain and changing requirements, 2) the difficulty of managing large software development teams, 3) the flexibility enabled by software which can lead to more demanding requirements, and 4) the challenges of characterizing the behavior of discrete systems. Software systems can range from simple to highly complex, depending on factors like purpose, lifespan, number of users, and role in research.
Object Oriented Methodology (OOM) is a system development approach encouraging and facilitating re-use of software components. We enforce our concern on components re-usability of existing component using Java Language .
SE18_Lec 06_Object Oriented Analysis and DesignAmr E. Mohamed
The document discusses key concepts in object-oriented systems development including classes, objects, attributes, methods, encapsulation, inheritance, polymorphism, relationships between classes such as associations and aggregations, and object persistence. Object-oriented development models real-world entities as classes of objects that encapsulate both data and behavior and can be organized into inheritance hierarchies.
CS8592 Object Oriented Analysis & Design - UNIT Ipkaviya
This document provides an introduction to Object Oriented Analysis and Design (OOAD) and the Unified Process (UP). It discusses key OOAD concepts like objects, classes, inheritance, polymorphism, and encapsulation. It then describes the Unified Process, an iterative software development approach that involves inception, elaboration, construction, and transition phases. Each phase includes requirements analysis, design, implementation, and testing activities. The document also discusses the Unified Modeling Language (UML) and diagrams used in OOAD like use case diagrams, class diagrams, and sequence diagrams.
The document discusses the Unified Approach (UA) methodology for software development proposed by Ali Bahrami. The UA aims to combine the best practices of other methodologies like Booch, Rumbaugh, and Jacobson while using the Unified Modeling Language (UML). The core of the UA is use case-driven development. It establishes a unified framework around these methodologies using UML for modeling and documenting the software development process. The UA allows for iterative development by allowing moving between analysis, design, and modeling phases.
This document provides an overview of object-oriented analysis and design. It discusses traditional software development approaches versus object-oriented approaches. The key aspects of object-oriented development covered include objects, classes, inheritance, encapsulation, and polymorphism. Software development life cycle stages like planning, analysis, design, implementation and testing are also summarized. The document compares structured and object-oriented approaches and provides examples of object-oriented programming and design methodologies.
The document discusses key concepts in object-oriented analysis and design including objects, classes, attributes, operations, relationships, inheritance, and polymorphism. It also provides an overview of the software development life cycle (SDLC) including common process models like waterfall and iterative development. The unified process model is introduced as a iterative approach used in SDLC.
The document discusses the process of designing view layer classes in a user interface. It involves:
1) Identifying view layer objects during analysis by examining use cases and interaction diagrams.
2) Designing individual view layer objects by applying design principles like simplicity and usability testing.
3) Iteratively refining the design by getting feedback and making improvements.
The document discusses architectural modeling in object-oriented analysis and design using UML. It describes package diagrams, component diagrams, and deployment diagrams which are used to model the architecture of a software system. These diagrams enable visualizing the physical distribution of components, determining if the design meets requirements, and depicting the hardware on which software components are deployed.
The document discusses static UML diagrams and provides an example of a class diagram for an ATM system. It begins by defining a class diagram and its key components - classes, attributes, operations, and relationships. It then explains different types of class relationships like inheritance, association, aggregation, and composition. The document concludes by providing a full class diagram example for an ATM system to demonstrate how all the concepts discussed come together in a diagram.
The document describes key components of software design including data design, architectural design, interface design, and procedural design. It discusses the goals of the design process which are to implement requirements, create an understandable guide for code generation and testing, and address implementation from data, functional, and behavioral perspectives. The document also covers concepts like abstraction, refinement, modularity, program structure, data structures, software procedures, information hiding, and cohesion and coupling.
Assignment 1 SYD601 2012 rick_danby completed with audioRickNZ
The document provides an overview of object-oriented systems development. It discusses object-oriented analysis, design, and programming. It covers key concepts like classes, objects, encapsulation, inheritance, polymorphism, and abstraction. It also discusses the unified process, a popular iterative software development process, and its four phases: inception, elaboration, construction, and transition.
Object Oriented Analysis and Design with UML2 part1Haitham Raik
The document provides an overview of object-oriented analysis and design (OOA&D) with UML. It discusses key concepts like use cases, requirements analysis, UML diagrams, and architectural analysis. The presenter provides an agenda that covers OOA&D overview, UML overview, requirements overview, use cases overview, basic OO concepts, and architectural analysis.
This document discusses function-oriented software design. It explains that function-oriented design represents a system as a set of functions that transform inputs to outputs. The chapter objectives are to explain function-oriented design, introduce design notations, illustrate the design process with an example, and compare sequential, concurrent and object-oriented design strategies. Topics covered include data-flow design, structural decomposition, detailed design, and a comparison of design strategies.
The document discusses key aspects of the software design process including that design is iterative and represented at a high level of abstraction, guidelines for quality design include modularity, information hiding, and functional independence, and architectural design defines system context and archetypes that compose the system.
The document presents the "4+1" view model for describing software architectures. It consists of five views: the logical view, process view, physical view, development view, and use case scenarios. Each view addresses different stakeholder concerns and can be described using its own notation. The logical view describes the object-oriented decomposition. The process view addresses concurrency and distribution. The physical view maps software to hardware. The development view describes module organization. Together these views provide a comprehensive architecture description that addresses multiple stakeholder needs.
Rumbaugh's Object Modeling Technique (OMT) is an object-oriented analysis and design methodology. It uses three main modeling approaches: object models, dynamic models, and functional models. The object model defines the structure of objects in the system through class diagrams. The dynamic model describes object behavior over time using state diagrams and event flow diagrams. The functional model represents system processes and data flow using data flow diagrams.
The document discusses several design techniques for software development including top-down design, bottom-up design, stepwise refinement, levels of abstraction, structured design, integrated top-down development, and Jackson structured programming. Top-down design starts by identifying major modules and decomposing them into lower level modules. Bottom-up design first identifies primitive objects, actions, and relationships. Stepwise refinement involves decomposing design decisions to elementary levels in small increments.
This summary provides an overview of the key concepts discussed in the document:
1. The document discusses various object-oriented analysis and design concepts including use case modeling, the Unified Modeling Language (UML), activity diagrams, associations, aggregation, and composition.
2. It provides descriptions and examples of these concepts, such as defining use cases, actors, and use case diagrams. Activity diagrams are described as showing workflows and processes.
3. The document also discusses UML notation for modeling associations, including binary and ternary associations, and modeling cardinality ratios between associated classes.
This document contains a chapter from a course manual on Object Oriented Analysis and Design. The chapter discusses the inherent complexity of software systems. It identifies four main reasons for this complexity: 1) the complexity of the problem domain and changing requirements, 2) the difficulty of managing large software development teams, 3) the flexibility enabled by software which can lead to more demanding requirements, and 4) the challenges of characterizing the behavior of discrete systems. Software systems can range from simple to highly complex, depending on factors like purpose, lifespan, number of users, and role in research.
Object Oriented Methodology (OOM) is a system development approach encouraging and facilitating re-use of software components. We enforce our concern on components re-usability of existing component using Java Language .
SE18_Lec 06_Object Oriented Analysis and DesignAmr E. Mohamed
The document discusses key concepts in object-oriented systems development including classes, objects, attributes, methods, encapsulation, inheritance, polymorphism, relationships between classes such as associations and aggregations, and object persistence. Object-oriented development models real-world entities as classes of objects that encapsulate both data and behavior and can be organized into inheritance hierarchies.
CS8592 Object Oriented Analysis & Design - UNIT Ipkaviya
This document provides an introduction to Object Oriented Analysis and Design (OOAD) and the Unified Process (UP). It discusses key OOAD concepts like objects, classes, inheritance, polymorphism, and encapsulation. It then describes the Unified Process, an iterative software development approach that involves inception, elaboration, construction, and transition phases. Each phase includes requirements analysis, design, implementation, and testing activities. The document also discusses the Unified Modeling Language (UML) and diagrams used in OOAD like use case diagrams, class diagrams, and sequence diagrams.
The document discusses the Unified Approach (UA) methodology for software development proposed by Ali Bahrami. The UA aims to combine the best practices of other methodologies like Booch, Rumbaugh, and Jacobson while using the Unified Modeling Language (UML). The core of the UA is use case-driven development. It establishes a unified framework around these methodologies using UML for modeling and documenting the software development process. The UA allows for iterative development by allowing moving between analysis, design, and modeling phases.
This document provides an overview of object-oriented analysis and design. It discusses traditional software development approaches versus object-oriented approaches. The key aspects of object-oriented development covered include objects, classes, inheritance, encapsulation, and polymorphism. Software development life cycle stages like planning, analysis, design, implementation and testing are also summarized. The document compares structured and object-oriented approaches and provides examples of object-oriented programming and design methodologies.
The document discusses key concepts in object-oriented analysis and design including objects, classes, attributes, operations, relationships, inheritance, and polymorphism. It also provides an overview of the software development life cycle (SDLC) including common process models like waterfall and iterative development. The unified process model is introduced as a iterative approach used in SDLC.
The document discusses the process of designing view layer classes in a user interface. It involves:
1) Identifying view layer objects during analysis by examining use cases and interaction diagrams.
2) Designing individual view layer objects by applying design principles like simplicity and usability testing.
3) Iteratively refining the design by getting feedback and making improvements.
The document discusses architectural modeling in object-oriented analysis and design using UML. It describes package diagrams, component diagrams, and deployment diagrams which are used to model the architecture of a software system. These diagrams enable visualizing the physical distribution of components, determining if the design meets requirements, and depicting the hardware on which software components are deployed.
The document discusses static UML diagrams and provides an example of a class diagram for an ATM system. It begins by defining a class diagram and its key components - classes, attributes, operations, and relationships. It then explains different types of class relationships like inheritance, association, aggregation, and composition. The document concludes by providing a full class diagram example for an ATM system to demonstrate how all the concepts discussed come together in a diagram.
The document describes key components of software design including data design, architectural design, interface design, and procedural design. It discusses the goals of the design process which are to implement requirements, create an understandable guide for code generation and testing, and address implementation from data, functional, and behavioral perspectives. The document also covers concepts like abstraction, refinement, modularity, program structure, data structures, software procedures, information hiding, and cohesion and coupling.
Assignment 1 SYD601 2012 rick_danby completed with audioRickNZ
The document provides an overview of object-oriented systems development. It discusses object-oriented analysis, design, and programming. It covers key concepts like classes, objects, encapsulation, inheritance, polymorphism, and abstraction. It also discusses the unified process, a popular iterative software development process, and its four phases: inception, elaboration, construction, and transition.
Object Oriented Analysis and Design with UML2 part1Haitham Raik
The document provides an overview of object-oriented analysis and design (OOA&D) with UML. It discusses key concepts like use cases, requirements analysis, UML diagrams, and architectural analysis. The presenter provides an agenda that covers OOA&D overview, UML overview, requirements overview, use cases overview, basic OO concepts, and architectural analysis.
This document discusses function-oriented software design. It explains that function-oriented design represents a system as a set of functions that transform inputs to outputs. The chapter objectives are to explain function-oriented design, introduce design notations, illustrate the design process with an example, and compare sequential, concurrent and object-oriented design strategies. Topics covered include data-flow design, structural decomposition, detailed design, and a comparison of design strategies.
The document discusses key aspects of the software design process including that design is iterative and represented at a high level of abstraction, guidelines for quality design include modularity, information hiding, and functional independence, and architectural design defines system context and archetypes that compose the system.
The document presents the "4+1" view model for describing software architectures. It consists of five views: the logical view, process view, physical view, development view, and use case scenarios. Each view addresses different stakeholder concerns and can be described using its own notation. The logical view describes the object-oriented decomposition. The process view addresses concurrency and distribution. The physical view maps software to hardware. The development view describes module organization. Together these views provide a comprehensive architecture description that addresses multiple stakeholder needs.
The document presents the "4+1" view model for describing software architectures. It consists of five views: the logical view, process view, physical view, development view, and use case scenarios. Each view addresses different stakeholder concerns and can be described using its own notation. The logical view describes the object-oriented decomposition. The process view addresses concurrency and distribution. The physical view maps software to hardware. The development view describes module organization. Together these views provide a comprehensive architecture description that addresses multiple stakeholder needs.
This document provides an overview of software architectures and architectural structures. It discusses different types of architectural structures, including module structures, component-and-connector structures, and allocation structures. Module structures focus on modules and their relationships, component-and-connector structures examine runtime components and connectors, and allocation structures show how software elements map to environments. The document then examines specific architectural structures like modules, layers, classes, processes, repositories, and deployment. It emphasizes that an architect should focus on a few key structures like logical, process, development, and physical views to validate that the architecture meets requirements.
The document discusses software architecture, including definitions, principles, patterns, and modeling techniques. It defines architecture as the structure of a system comprising software elements and relationships. Some key principles discussed are single responsibility, open/closed, and dependency inversion. Common patterns like MVC, layered, and multitier architectures are explained. The document also introduces Unified Modeling Language (UML) for modeling systems using diagrams like class, component, and package diagrams.
Third AssignmentDescribe in 100 – 200 words an application with .docxrandymartin91030
Third Assignment
Describe in 100 – 200 words an application with which you are familiar. This should be an application with which other students and the course instructor are likely to be familiar. An example would be Microsoft Word. Then, select one of the architectural design styles given in the presentation on Architectural Design. Explain why this style is appropriate for the application you described. Then apply this style to the application and explain the result in enough detail that your fellow students are likely to understand.
Organization of your submission
Third Assignment
Your name
Submission Date
Application Description
Style you have selected
Why this style is appropriate for this application
The application’s architecture using this style
Explanation of this architecture (show how some common tasks for this application might be performed using this architecture)
Grading Rubric
Criterion
Points
Application description is well-organized
5
Style choice is one of the styles described
2
Style choice is effectively justified
8
Presented architecture uses the selected style
3
Presented architecture is complete
4
Architecture is described clearly
8
Chapter 7:
Design: Architecture and Methodology
1
Design Topics Covered
Architectural vs. detailed design
“Common” architectural styles, tactics, and reference architectures
Basic techniques for detailed design
Basic issues with user-interface design
2
Design
Starts mostly from/with requirements (evolving mostly from functionalities and other non-functional characteristics).
How is the software solution going to be structured?
What are the main components—(functional comp)?
Often directly from requirements’ functionalities
(use cases).
How are these components related?
Possibly re-organize the components (composition/decomposition).
Two main levels of design:
Architectural (high level)
Detailed design
How should we depict design—notation/language?
3
Relationship between Architecture and Design
Detailed Design
Comes from
Requirements &
Architecture
4
Software Architecture
Structure(s) of the solution, comprising:
Major software elements
Their externally visible properties
Relationships among elements
Every software system has an architecture.
May have multiple structures!
Multiple ways of organizing elements, depending on the perspective
External properties of components (and modules)
Component (module) interfaces
Component (module) interactions, rather than internals of components and modules
5
Views and Viewpoints
View – representation of a system structure
4+1 views (by Krutchen)
Logical (OO decomposition – key abstractions)
Process (run-time, concurrency/distribution of functions)
Subsystem decomposition
Physical architecture
+1: use cases
Other classification (Bass, Clements, Kazman)
Module
Run-time
Allocation (mapping to development environment)
Different views for different people
6
Architectural Styles/Patterns
Pipes a.
The document discusses various design concepts and elements of the design model in software engineering. It covers 12 key design concepts including abstraction, architecture, patterns, separation of concerns, modularity, and information hiding. It also discusses design classes, refinement, aspects, and refactoring. Additionally, it outlines elements of the design model including data design, architectural design, interface design, component-level design, and deployment-level design. The goal of design is to create a model of software that will correctly implement requirements and provide joy to users.
Function Oriented and Object Oriented Design,Modularization techniquesnimmik4u
Design activity & its objectives – Function Oriented and Object Oriented Design- Modularization techniques - module structure and its representation, interface and information hiding, categories, specific techniques to accommodate change, stepwise refinement, top-down and bottom-up design - Handling anomalies.
SADP PPTs of all modules - Shanthi D.L.pdfB.T.L.I.T
The document discusses design patterns and software architecture. It includes an introduction to design patterns, describing what they are and how they solve common design problems. It also provides details on various design patterns organized in a catalog, including creational, structural and behavioral patterns. The document gives an example of using the Model-View-Controller (MVC) pattern in Smalltalk and provides a template for describing design patterns.
The document discusses object-oriented design and its role in software development. It describes how design builds upon analysis to provide implementation details. Key aspects of object-oriented design include defining a multilayered architecture, specifying subsystems and components, describing classes and objects, and defining communication mechanisms. The input to design comes from artifacts created in analysis like use cases and class models. The output of design serves as a blueprint to guide construction.
The document discusses object-oriented design using UML. It describes the design process, including refining the analysis model into a design model with more implementation details. Key artifacts of design include interfaces, subsystems, and classes. Maintaining both analysis and design models is recommended for large, complex systems. Design axioms aim to maximize independence between components and minimize complexity. Corollaries provide guidelines for loosely coupled, single-purpose classes with strong mappings between analysis and design models.
The document discusses architectural design in software engineering. It covers topics like architectural design decisions, views, patterns, and application architectures. Architectural design involves identifying major system components and their communications in order to represent the link between specification and design processes. Common architectural patterns discussed include model-view-controller, layered architectures, repositories, client-server, pipes and filters. The document also provides examples of architectures for different types of applications like transaction processing systems and information systems.
This thesis explores how non-functional requirements (NFRs) can drive software architecture design. It proposes a model-driven development framework that fully integrates NFRs. Empirical studies show that architects consider NFRs just as important as functional requirements when making decisions. The thesis also presents Arteon, an ontology for architectural knowledge; Quark, a method for decision-making based on NFRs; and ArchiTech, a tool that implements Arteon and Quark.
The document discusses object-oriented design and analysis. It covers key aspects of the design phase including identifying classes, class responsibilities, and relationships between classes. The purposes of the design phase are to gather information for implementation, reduce implementation time and cost, and be the most time-consuming phase. Results of design include text descriptions and diagrams depicting relationships, usage scenarios, and state changes. The document also discusses translating analysis concepts into design, including understanding quality attributes, constraints, and requirements.
This document provides an overview of topics related to architectural design, including architectural design decisions, views, patterns, and application architectures. It discusses software architecture and the goals of architectural design. Specific architectural patterns covered include Model-View-Controller (MVC) and layered architectures. Examples are provided to illustrate how these patterns can be applied.
Chapter 7 Design Architecture and Methodology1.docxmccormicknadine86
Chapter 7:
Design: Architecture and Methodology
1
Design Topics Covered
Architectural vs. detailed design
“Common” architectural styles, tactics, and reference architectures
Basic techniques for detailed design
Basic issues with user-interface design
2
Design
Starts mostly from/with requirements (evolving mostly from functionalities and other non-functional characteristics).
How is the software solution going to be structured?
What are the main components—(functional comp)?
Often directly from requirements’ functionalities
(use cases).
How are these components related?
Possibly re-organize the components (composition/decomposition).
Two main levels of design:
Architectural (high level)
Detailed design
How should we depict design—notation/language?
3
Relationship between Architecture and Design
Detailed Design
Comes from
Requirements &
Architecture
4
Software Architecture
Structure(s) of the solution, comprising:
Major software elements
Their externally visible properties
Relationships among elements
Every software system has an architecture.
May have multiple structures!
Multiple ways of organizing elements, depending on the perspective
External properties of components (and modules)
Component (module) interfaces
Component (module) interactions, rather than internals of components and modules
5
Views and Viewpoints
View – representation of a system structure
4+1 views (by Krutchen)
Logical (OO decomposition – key abstractions)
Process (run-time, concurrency/distribution of functions)
Subsystem decomposition
Physical architecture
+1: use cases
Other classification (Bass, Clements, Kazman)
Module
Run-time
Allocation (mapping to development environment)
Different views for different people
6
Architectural Styles/Patterns
Pipes and filters
Event driven
Client-server
Model-view-controller (MVC)
Layered
Database centric
Three tier
We discuss architectural styles/patterns as
“reusable” starting point for design activities.
7
Pipe-Filter Architecture Style
The high-level design solution is decomposed into two “generic” parts (filters and pipes):
Filter is a service that transforms a stream of input data into a stream of output data.
Pipe is a mechanism or conduit through which the data flows from one filter to another.
Input
time cards
Prepare for
check processing
Process checks
Problems that require batch file processing seem to fit this architecture: e.g., payroll, compilers, month-end accounting.
** Reminds one of DFD without the data store or source sink.**
8
Event Driven (Real Time)
The high-level design solution is based on an event dispatcher, which manages events and the functionalities that depend on those events. These have the following characteristics:
Events may be a simple notification or may include associated data.
Events may be prioritized or be based on constraints such as time.
Events may require synchronous or asynchronous processing.
Events may be “registered” ...
The document discusses component-level design in software engineering. It defines component-level design as defining the internal data structures, algorithms, interfaces, and communication mechanisms for each software component. It discusses views of components, design principles like open-closed and dependency inversion, and steps for component-level design including class elaboration, modeling persistent data sources, and refining deployment diagrams.
The document discusses object-oriented databases (OODBs). It states that choosing the right OODB architecture is crucial for performance and scalability, more so than with relational databases. With OODBs, the application architecture has a greater impact on performance compared to relational databases, as OODBs provide more direct access to persistent data. Consequently, the application architecture affects performance and scalability more than the choice of OODB.
Design patterns are commonly used to address problems relating to application architecture and design. The concept originated from Christopher Alexander's work noting common building design problems and solutions. Design patterns ensure problems are addressed through well-known solutions, and most problems have likely been solved before. Common patterns include observer/subject to separate user interface from business logic, singleton to control object construction, strategy to allow multiple algorithms, and template method to define an algorithm's structure. The facade pattern provides different views of subsystems to users by hiding implementation details. The command pattern encapsulates requests as objects with a known interface to decouple senders and receivers.
The document discusses architectural design and provides examples of different architectural patterns and application architectures. It begins with defining architectural design and its role in the system design process. It then covers topics such as architectural views, patterns like Model-View-Controller and layered architectures. Examples are given of different application architectures for transaction processing and information systems. Key decisions in architectural design and documenting architectures are also summarized.
Similar to OO Development 6 - Software Design (20)
Celebrating the Release of Computing Careers and DisciplinesRandy Connolly
Talk given at CANNEXUS 2020 on the release of our Computing Careers and Disciplines booklet, which has gone on to be downloaded over 200000 times since its release.
Public Computing Intellectuals in the Age of AI CrisisRandy Connolly
This talk advocates for a conceptual archetype (the Public Computer Intellectual) as a way of practically imagining the expanded possibilities of academic practice in the computing disciplines, one that provides both self-critique and an outward-facing orientation towards the public good.
Lightning Talk given at the start of the celebration evening for the ten-year anniversary of our Bachelor of Computer Information Systems at Mount Royal University.
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Randy Connolly
Talk given at SIGCSE'19. Web development continues to grow as an essential skill and knowledge area for employed computer science graduates. Yet within the ACM CS2013 curriculum recommendation and within computing education research in general, web development has been shrinking or even disappearing all together. This paper uses an informal systematic literature review methodology to answer three research questions: what approaches are being advocated in existing web development education research, what are current trends in industry practice, and how should web development be taught in light of these current trends. Results showed a significant mismatch between the type of web development typically taught in higher education settings in comparison to web development in industry practice. Consequences for the pedagogy of web development courses, computer science curriculum in general, and for computing education research are also discussed.
Mid-semester presentation for my Computers & Society course at Mount Royal University. Has some technical detail about how the internet works, web protocols, data centres, and typical security threats.
The document provides a summary of modern web development topics covered in 3 sentences or less:
Modern Web Development topics covered include the infrastructure of the internet, client-server communication models, the need for server-side programs, web architecture patterns, JavaScript's central role, front-end frameworks, cloud computing models, microservices architecture, and containers. Web development has become more complex with client-side logic, front-end frameworks, and the rise of cloud, microservices, and containers, which allow for more modular and scalable application development. Future trends discussed include progressive web apps, microservices architecture, and containers as a lightweight deployment mechanism for microservices.
Helping Prospective Students Understand the Computing DisciplinesRandy Connolly
Presentation at Cannexus 2018 in Ottawa in which we discussed the results of our three-year research project on student understandings of the computing disciplines and described the 32-page full-color booklet for advisers and prospective students.
This document discusses the process of constructing a textbook on web development. It covers planning the textbook's topics and structure, writing the content over 7 months while splitting chapters with a co-author, undergoing review processes, redrawing over 120 diagrams in a new style, and producing a second edition with additional content such as JavaScript and CSS3. Key challenges included navigating copyright issues, outsourcing production, and ensuring diversity in illustrations. The document provides insight into the lengthy efforts required to research, write, and produce a college textbook.
Talk given at University of Applied Sciences at Krems , Austria for Master Forum 2017. Provides a rich overview of contemporary web development suitable for managers and business people.
Disrupting the Discourse of the "Digital Disruption of _____"Randy Connolly
Talk given at University of Applied Sciences for Management and Communication in Vienna in January 2017. It critically interrogates the narrative of digital disruption. It will describe some of the contemporary psychological and social research about the digital lifeworld and make some broader observations about how to best think about technological change.
Every year at our new student orientation, I used to give this talk to our first year students. Instead of telling them what they should do to achieve success, we thought it would be more effective and humourous to tell them instead how best to fail your courses. This was the last version of this talk from 2017.
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Randy Connolly
This 2016 presentation (for a paper) updates the findings of a multi-year study that is surveying major and non-major students’ understanding of the different computing disciplines. This study is a continuation of work first presented by Uzoka et al in 2013, which in turn was an expansion of work originally conducted by Courte and Bishop-Clark from 2009. In the current study, data was collected from 668 students from four universities from three different countries. Results show that students in general were able to correctly match computing tasks with specific disciplines, but were not as certain as the faculty about the degree of fit. Differences in accuracy between student groups were, however, discovered. Software engineering and computer science students had statistically significant lower accuracy scores than students from other computing disciplines. Consequences and recommendations for advising and career counselling are discussed.
Constructing and revising a web development textbookRandy Connolly
A Pecha Kucha for WWW2016 in Montreal. Web development is widely considered to be a difficult topic to teach successfully within post-secondary computing programs. One reason for this difficulty is the large number of shifting technologies that need to be taught along with the conceptual complexity that needs to be mastered by both student and professor. Another challenge is helping students see the scope of web development, and their role in an era where the web is a part of everyday human affairs. This presentation describes our 2014 textbook and our plans for a second edition revision (which will be published in early 2017).
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesRandy Connolly
This presentation reports the initial findings of a multi-year study that is surveying major and non-major students’ understanding of the different computing disciplines. This study is based on work originally conducted by Courte and Bishop-Clark from 2009, but which uses a broadened study instrument that provided additional forms of analysis. Data was collected from 199 students from a single institution who were computer science, information systems/information technology and non-major students taking a variety of introductory computing courses. Results show that undergraduate computing students are more likely to rate tasks as being better fits to computer disciplines than are their non-major (NM) peers. Uncertainty among respondents did play a large role in the results and is discussed alongside implications for teaching and further research.
Citizenship: How do leaders in universities think about and experience citize...Randy Connolly
This presentation explores the concept of citizenship based on the experience of student leaders from a mid-sized university in western Canada. Five student leaders participated in semi-structured individual interviews to explore their experience with, and understanding of, citizenship. Interviews concentrated on personal view points and definitions of citizenship, explored whether or not there are “good” and “great” citizens, and the role universities play in fostering strong citizenship amongst its student body. The measurement of citizenship and opportunities to foster citizenship were also explored. Qualitative content analysis revealed five themes, including political participation, social citizenship/solidarity, engagement, transformative action and autonomy. Citizenship, while highly valued by this population, also appears to be impossible to measure. If post-secondary institutions are aiming to create better citizens, more work needs to be done to create a common understanding of the intended outcome. Based on these findings, a new potential model of citizenship is proposed, in line with the work of Dalton and others who emphasize a shift towards personal involvement over traditional political engagement. Further, these results suggest that students could benefit from understanding themselves as political agents, capable of inculcating change within the university context and beyond.
Presentation for a guest lecture for a colleague's Media History and Contemporary Issues course. She wanted me to cover technological determinism and social constructivism, as well as through in some content about my research on multitasking and online reading.
A longitudinal examination of SIGITE conference submission dataRandy Connolly
Presents our examination of submission data for the SIGITE conference between the years 2007-2012. SIGITE is an ACM computing conference on IT education. The presentation describes which external factors and which internal characteristics of the submissions are related to eventual reviewer ratings. Ramifications of the findings for future authors and conference organizers are also discussed. If you want to read the full paper, visit http://dl.acm.org/citation.cfm?id=2656450.2656465
This document is a chapter from a textbook on web development security. It covers several key security principles for web development, including the CIA triad of confidentiality, integrity and availability. It discusses risk assessment and management, including identifying actors, impacts, threats and vulnerabilities. Authentication methods like passwords, multifactor authentication and third party authentication are explained. The importance of authorization to define user privileges is also covered. Overall security practices like secure design, testing, policies and business continuity planning are recommended.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
3. Our Process
3
Reminder of object-oriented development
process we are following in this course is that
there are four phases:
Inception
Elaboration
Construction
Transition
Inception El aborati on Construction Transiti on
Each phase consists of one or more iterations 1 2 3 4 5 6 7 8
of the following workflows: Requirem ents
Requirements
Anal y s is
Analysis & Design
Implementation
Des i gn
Test
In this section, we are going to examine the Implement ation
design workflow principally in the context of
the Elaboration and construction phases. T es t
4. Design Workflow
4
In the analysis workflow, the requirements are
analyzed in more detail, so as to begin the
description of the internal structure and behavior of
the proposed system.
In the design workflow, we more fully describe and
model how the internal structure and behavior will
be implemented.
The design workflow is the primary modeling activity of
the last part of the elaboration and first half of the
construction phases.
Source: Arlow and Neustadt, UML and the Unified Process (Addison-Wesley, 2002), p. 249-50.
5. Object-Oriented Design
5
Our analysis model defines what we need to build.
It doesn’t define how the system will be build
Object-oriented design determines how to build.
Object-oriented design bridges the gap between analysis and
implementation.
In the design phase, you :
add detail about user interface,
specify data storage,
add layers,
re-evaluate the responsibilities spelled out in interaction diagrams,
add detail to class diagrams so as to create design classes, and re-
evaluate and
re-factor your initial analysis model using best-practice solutions and
heuristic principles called patterns.
Source: Bennett, McRobb, and Farmer, Object-Oriented Systems Analysis and Design (McGraw Hill, 2002), p. 301.
6. Analysis versus Design
6
The boundary between analysis and design can be
quite vague; they often overlap.
Some software processes merge the analysis and
design stages.
Inreal iterative projects, after an initial design model is
created, the analysis model tends to become redundant
and is no longer maintained.
for smaller projects (under 200 classes), the design
model may be small enough to be understandable, so
a separate analysis model may be unnecessary.
Source: Arlow and Neustadt, UML and the Unified Process (Addison-Wesley, 2002), p. 252-3.
7. System Design and Detailed
7
Design
Design of systems takes place at two levels:
System design
Also called software architecture design.
Concerned with the overall architecture of the system
Detailed design
Also called class design
Concerned with designing individual components to fit this
architecture.
Source: Bennett, McRobb, and Farmer, Object-Oriented Systems Analysis and Design (McGraw Hill, 2002), p. 305.
8. What is Software Architecture?
8
The system design of an application is also referred to
as software architecture.
Software architecture is a shared understanding of a
system's design by the developers on a project.
Commonly this shared understanding is in the form of the
major components of the system and how they interact.
Two key aspects:
It is the highest-level breakdown of a system into its parts.
It is about early decisions that are hard to change after the
system is implemented.
Source: Martin Fowler, Patterns of Enterprise Application Architecture (Addison-Wesley, 2003), p. 2.
9. System Design
9
In system/architectural design, you define the
larger parts of the system and how they relate.
That is, system design is focused on making high-level
decisions concerning the overall structure of the system.
This is accomplished by identifying layers (also called
sub-systems) and allocating classes to them.
10. Layering
10
Layering is perhaps the most common way to
architect a software system.
Layering is a way of organizing your software
design into groups of classes that fulfill a common
purpose.
Source: Frank Buschmann et al, A Pattern of Systems (Wiley, 1996), p. 31-51.
11. Layering
11
The goal of layering is to distribute the functionality of
your software among classes, so that the coupling of a
given class is minimized.
While a layer may have dependencies to another layer’s
interface, it should be independent of other layer's
implementation.
We want to avoid having late changes to a class "ripple"
(cause changes) to a host of other classes.
Layering can thus increase the modularity (and thus
maintainability) of your system.
Different layers can be constructed by different team
members.
Source: Frank Buschmann et al, A Pattern of Systems (Wiley, 1996), p. 31-51.
12. Layering
12
The essential principle of layering is that any
element within a layer depends only on other
elements "beneath" it.
The top layers typically contain either the most
abstraction, or the most variable elements.
Each layer should be loosely coupled to the layers
underneath. Layer 4
Layer 3
Layer 2
Layer 1
Source: Eric Evans, Domain-Driven Design (Addison-Wesley, 2003), p. 69.
13. Open versus Closed Architecture
13
Layer architectures may be open or closed.
Closed architecture minimizes the dependencies
between layers and makes for more independent
layers.
That is, each layer is strongly encapsulated.
Source: Bennett, McRobb, and Farmer, Object-Oriented Systems Analysis and Design (McGraw Hill, 2002), p. 326.
14. Open versus Closed Architecture
14
Open architecture is more efficient but less
maintainable due to the increased dependencies.
Theoretically, a closed layer architecture is best, but
open-layer architectures are much easier to create.
Layer 4 Arrows indicate message flow Layer 4
Layer 3 Layer 3
Layer 2 Layer 2
Layer 1 Layer 1
Closed layer architecture Open layer architecture
Source: Bennett, McRobb, and Farmer, Object-Oriented Systems Analysis and Design (McGraw Hill, 2002), p. 326.
15. Common Layer Architectures
15
Presentation Presentation
Business Logic Application
Data Access Domain
Three layer architecture Data Access
Four layer architecture
View Boundary
Controller Control
Model Entity
MVC architecture BCE architecture
Source: Bennett, McRobb, and Farmer, Object-Oriented Systems Analysis and Design (McGraw Hill, 2002), p. 328-30.
16. Common Layer Architectures I
16
Presentation Layer
Responsible for showing information to the user and
interpreting the user's commands.
Business Layer
Contains all business logic.
Data Access/Persistence Layer
Responsible for interacting with external data sources. All
database related code should reside here.
Presentation
Business
Data Access
17. Common Layer Architectures II
17
«boundary»
Boundary ViewCustomerList
Boundary layer refer to any classes that interact directly with
the actors.
Should only communicate with Control layer classes
Entity ViewCustomerList
Entity layer contain classes that represent objects in the problem
domain. «entity»
Customer
Should have no knowledge of Boundary or Control classes.
Control
Control layer classes coordinate between the boundary and
entity layers.
Customer
Represent the application logic
Often, each use case will have a control class
«control»
Boundary CustomerListController
Control
Entity CustomerListController
18. Common Layer Architectures III
18
Presentation Layer
Responsible for showing information to the user
Presentation
and interpreting the user's commands.
Application Layer Application
Defines the job the software is supposed to do
and directs the domain objects. Domain
Domain Layer Infrastructure
Responsible for representing concepts of the
business.
Infrastructure Layer
Provides technical capabilities that support the
higher layers (e.g., persistence, web services,
general widget drawing, security, etc).
Source: Eric Evans, Domain-Driven Design (Addison-Wesley, 2003), p. 70.
19. Common Layer Architectures IV
19
Presentation Layer Presentation
Responsible for showing information to the user
and interpreting the user's commands. Presentation Helper
Presentation Helper Layer
This layer hides all the complexity of the Service
application layer and it is adapted to the
specific presentation layer implementation . Persistence
Service Layer
The service layer provides a layer of services to Domain
the presentation layer that it can use.
Domain Layer
Responsible for representing concepts of the
business. This layer focuses on concepts or entities
rather than use cases.
Persistence/Data Access Layer
The persistence layer encapsulates the data tier.
Source: Jimmy Nilsson, "A Pure Object-Oriented Object Model," www.vb2themax.com
20. Common Layer Architectures V
20
UI Component Layer UI Component
Responsible for showing information to the user and interpreting the user's
commands using UI components (windows forms, web pages, user controls,
UI Process
etc)
UI Process Layer
Business Process Domain
Infrastructure
Handles validation and navigation between UI components.
Business Process Layer
Business processes reflect the macro-level activities that the business Data Access Components
performs. Examples include order processing, customer support, and
procurement of materials. These business processes are encapsulated by
business workflow components that orchestrate one or more domain objects Data Access Helper
to implement a business process.
Domain/Business Objects Layer
Data Access Components
Data access components isolate the business layer from the details of the
specific data storage solution. Each DAC might provide CRUD (create,
retrieve, update, and delete) capabilities for its data source.
Data Access Helper
Common helper classes used by the DACs.
Infrastructure
Source: Jimmy Nilsson, "A Pure Object-Oriented Object Model," www.vb2themax.com
21. Diagramming Layers
21
«layer» «layer»
User Interface Controllers
«traces»
«boundary» «boundary» «boundary»
Client List Client Details Portfolio List
22. Class Design
22
Concerned with the detailed design of the classes in
the layers and their interactions.
The result will be a detailed specification of the
attributes and operations of all the classes.
Customer Customer
-m_name: String
Analysis class -m_address: String
-m_phone: String
#numCustomers: int
+getName(): String
+getPhone(): String
+setName(name: String): void
+setPhone(phone: String): void
#getNumCustomers(): int
Design class
23. Class Design
23
The static class diagram is always at the focus of
our analysis and design activities, since it indicates
what will be implemented.
As part of the analysis phase, one may have created
several interaction diagrams for most of the important
scenarios in each use case.
As these interaction diagrams are developed, we need
to add the behaviors necessary to model the
responsibilities in these scenarios.
This may be done as part of the analysis model
Or it may be done now in the design phase
24. Class Design
24
A newly-developed system will be extended many
times over its life.
Thus,merely designing an implementation that meets
current requirements is not sufficient.
The design must be flexible enough to permit extension
and reuse.
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 127.
25. Symptoms of Poor Design
25
Rigidity
The design is hard to change
Fragility
The design is easy to break
Immobility
The design is hard to reuse
Repetition
The design is only practical using copy and paste
Source: Robert C. Martin, Agile Software Development (Prentice Hall, 2003), p. 85.
26. Class Design Principles
26
Completeness and Sufficiency
Primitiveness
High Cohesion
Low Coupling
27. Completeness and Sufficiency
27
Completeness refers to giving users of a class the
services they expect.
Users tend to make assumptions about the services from the
name and semantics of a class.
e.g., a Client class will be expected to have methods for
accessing/setting a client’s name, while a BankAccount class will
be expected to have a Withdrawal method.
Sufficiency refers to the fact all methods of a class are
entirely focused on realizing the intent behind the class.
A class should not surprise a user. It should contain the
expected methods and no more.
Sufficiency is thus about keeping a class as simple and
focused as possible.
Source: Arlow and Neustadt, UML and the Unified Process (Addison-Wesley, 2002), p. 261.
28. Primitiveness
28
Methods should be designed to offer a single
primitive, atomic and unique service.
A class should not offer multiple ways of doing the
same thing.
Your aim is that classes should make available the
simplest and smallest possible set of methods necessary
to implement the behavior required by class.
BankAccount BadBankAccount
+deposit(in value) +deposit(in value)
+depositTwice(in value1, in value2)
BankAccount ba = new BankAccount();
ba.deposit(300); BadBankAccount ba = new BadBankAccount();
ba.deposit(1200); ba.depositTwice(300, 1200);
Yes! No!
Source: Arlow and Neustadt, UML and the Unified Process (Addison-Wesley, 2002), p. 262.
29. High Cohesion
29
Cohesion is a measure of the diversity of an class's
features.
The less diverse its features are, the more cohesive the class.
A highly cohesive class represents a single abstraction /
concept / activity / responsibility.
Each class in a design should be as cohesive as possible.
That is, its responsibilities should be as strongly-related and
focused as possible.
Cohesive classes are generally easier to understand, reuse and
maintain.
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 128.
30. Cohesion
30
A class with low cohesion tends to cause these problems:
More difficult to understand
Harder to reuse, and maintain
More possibilities for bugs since more affected by change
low cohesion
CustomerAccount
-accountNo
-lastname
-firstname How many abstractions does this class contain?
-address
-balance
low cohesion
Employee
+getName() How many abstractions does this class contain?
+getPhone()
+printName()
+calculatePension()
+calculateTax()
+displayChildren()
+displayBenefits()
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 129.
31. Cohesion
31
In classes with low cohesion, there is an assumption
that two (or more) abstractions in the class are
always in a one-to-one-relationship, which can
cause problems later.
Similarto rule against transitive dependencies in
database normalization.
You may have to specialize the class along different
dimensions based on the different abstractions.
CustomerAccount
-accountNo
-lastname
-firstname
-address
-balance
1 1..*
Customer Account Separate the two abstractions
32. Low Cohesion and Inheritance
32
Account
Inidividual Institutional
Cash Account Margin Account
Account Account
How many abstractions does each subclass contain?
Account
Inidividual Institutional
Cash Account Margin Account
Account Account
Individual Cash Individual Margin Institutional Cash Institutional
Account Account Account Margin Account
Problems when we further specialize the classes
33. High Cohesion and Inheritance
33
1..* *
Customer Account Separate the two abstractions
1..* *
Customer Account
Inidividual Institutional
Cash Account Margin Account
Account Account
Then specialize the two abstractions
34. Low Coupling
34
Coupling is a measure of the interconnectedness of
a class to other classes.
That is, coupling occurs when one class depends on
another in some way.
The greater the coupling, the greater the
interdependence among classes.
When classes are highly coupled, changes in one class
affect all the other classes.
As coupling is reduced, a design will become more
maintainable and extensible.
“coupling is your worst enemy” [Arlow & Neustadt, p. 263]
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 128.
35. Coupling
35
:Menu :House : Room
<< create >>
Menu is coupled to two other classes
initialize()
:Menu :House : Room
<< create >>
Now Menu is coupled to just one class
initialize()
36. Coupling Example
36
1: makePayment() 2: addPayment() 3: new()
: Register : Sale p : Payment
lower coupling
1: makePayment() 2: new()
: Register p : Payment higher coupling
3:
ad
dP
ay
m en
t()
: Sale
37. Coupling
37
Of course, some coupling is necessary; otherwise the
classes don’t interact.
There is no rule for how much coupling is too much.
One thing you can look for is “finger” effects in your
sequence diagram (see next slide); better to have
“stair” effects.
38. Stair vs Finger in Sequence Diagrams
Object1 Object2 Object3 Object4 Object5 Object6
38
Message1
Message2
Message3 Finger
Indicative of high coupling
Message4
Message5
Object1 Object2 Object3 Object4 Object5 Object6
Message1
Message2
Message3
Stair
Message4 Indicative of low coupling
Message5
39. Types of Coupling
39
Some of the forms of coupling are:
interaction coupling
identity coupling
representational coupling
subclass coupling
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 133.
40. Interaction Coupling
40
A measure of the number of message types an object
must send to another object and the number of
parameters passed with those messages.
Should try to reduce interaction coupling in order to increase
object reusability and to reduce number of potential
changes in other classes if a class’s interface changes.
MyDataAccess da = new MyDataAccess();
da.setName("wine");
da.setExtension("mdb");
da.setType("Microsoft Access"); * Illustrates high interaction coupling if all these messages
da.setDriverAccess("odbc"); must be sent before runSql message
da.setDriverType("access");
da.runSql(strSQL, READ_ONLY, READ_FORWARD, DYNAMIC_CURSOR, REPLICATION_ON, LOGGING_YES, USE_OLAP)
**
Illustrates high interaction coupling if all these parameters
must be used as part of the runSql message
Source: Bennett, McRobb, and Farmer, Object-Oriented Systems Analysis and Design (McGraw Hill, 2002), p. 352-3.
41. Identity Coupling
41
Refers to the level of connectivity of a design
If one object holds a reference / pointer to another
object, that object knows the identity of the other,
and therefore, exhibits identity coupling.
You can reduce identity coupling by :
eliminating unnecessary associations from your class
diagram
by implementing associations in only one direction if
bidirectional associations are unnecessary.
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 133.
42. Identity Coupling
42
This example has higher identity coupling. House
has knows the identity of rooms (it has a room
House Room collection) and room knows the identity of its
house (it has a pointer to house).
-m_rooms : Vector * -m_house : House
1
+addRoom() +setHouse() We may need this identity coupling (perhaps we
+getRoom() also have a master list of Rooms that we need to
examine independently of their house containers),
Higher coupling But if we don't then we should eliminate
bidirectional association.
has
House Room This example has less identity coupling. House
knows the identity of rooms (it has a room
-m_rooms : Vector *
1 collection) but room does not know the identity of
+addRoom() its house.
+getRoom()
Lower coupling
(preferred)
43. Representational Coupling
43
Classes should not depend on the specific representation /
implementation details of another class.
e.g., accessing public attributes of a class results in a very high-
degree of representational coupling.
Low representational coupling enables:
prototyping using frameworks and stubs
easier standardization (easier to standardize interfaces than
implementations)
Extensibility
Representational coupling can be reduced by making
attributes private, and using accessor and mutator methods
(getters and setters) for those attributes.
44. Representational Coupling
44
Item
+name : String Item abc = new Item();
+quantity : int abc.name = "towel"; High coupling
abc.quantity = 3;
Item
-name : String
-quantity : int
+getName() : String
+setName() : void Item abc = new Item(); Low coupling
+getQuantity() : int abc.setName("towel"); (preferred)
+setQuantity() : void Aabc.setQuantity(3);
45. Subclass Coupling
45
Inheritance is the strongest form of coupling!
When an object refers to a subclass object through a
subclass reference, rather than through a more general
superclass reference, you have subclass coupling.
A client should try to refer to the most general class possible,
thereby decoupling the client from the specific subclasses.
Client Superclass Client Superclass
Subclass 1 Subclass 2 Subclass 1 Subclass 2
High coupling Low coupling
(preferred)
Source: Charles Richter, Designing Flexible Object-Oriented Systems with UML (Macmillan, 1999), p. 134.
46. Subclass Coupling
46
Obviously you do need to create instances of
subclasses.
Later,we will learn about the Factory pattern as a way
to reduce subclass coupling.
As well, you should aim to structure your code so
that only a small portion of the application deals
with the subclass references (such as those to
instantiate the subclasses), whereas the rest of the
application deals only with general superclass
types.
47. Subclass Coupling
47 House
-m_rooms Room
+addRoom()
ControlHouse
Kitchen Bedroom
BoundaryHouse ControlRoomCreator
ControlHouse
...
public void newRoom(int roomType, ...)
{
ControlRoomCreator crc = new ControlRoomCreator();
Room r = crc.createRoom(roomType) ;
m_house.addRoom( r );
}
ControlRoomCreator House
... ...
public Room createRoom(int roomType, ...) public void addRoom(Room r)
{ {
if (roomType == Room.KITCHEN) m_rooms.addElement(r);
return new Kitchen( ... ); }
else if (roomType == Room.BEDROOM)
return new Bedroom( ... );
}
48. Coupling Review
48
It is not high coupling per se that is so problematic,
but high coupling to classes that are unstable (i.e.,
change frequently).
high coupling to stable and pervasive elements such as
the standard Java libraries for string manipulation,
collections, etc is not that problematic.
Thus, in particular, avoid high coupling for classes
that change their interface or implementation
frequently.
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 231
49. Additional Class Design
49
Guidelines
Mapping responsibilities using Information expert and creator
Avoid public fields
Prevent misuse by client
Establish invariants in constructor
Refactor duplicate code
Separate interface from implementation
Minimize interface size
Program to interface
Controllers
Replace Conditionals with Polymorphism
Improve Cohesion or Coupling by Pure Fabrication
Indirection
Don’t Talk to Strangers
Be Cautious with Inheritance
Favour object composition over class inheritance
50. Design Guideline: Information
50
Expert
Problem:
how to assign responsibilities to objects?
Solution:
Assign a responsibility to the class that has the
information necessary to fulfill the responsibility.
Larman calls this the Information Expert principle
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 221-2
51. Who is the Information Expert?
51
Sale
-m_date
-m_time
1
contains
*
described by
Sales Detail Product
-quantity * -description
1 -price
Who should have responsibility for calculating the grand total of the sale?
52. Who is the Information Expert?
52
getTotal() getSubTotal()
: Sale : Sales Detail
getPrice()
: Product
Now each object is responsible for providing the data it owns.
Sale
-m_date
-m_time
+getTotal()
1
contains
*
described by
Sales Detail Product
-quantity * -description
1 -price
+getSubTotal()
+getPrice()
53. Multiple Information Experts
53
The fulfillment of a responsibility often requires
information that is spread across different classes
of objects
Thusthere are often several partial information experts
who will collaborate on the task of fulfilling the
responsibility.
54. Design Guideline: Creator
54
Problem:
Who should be responsible for creating an object?
Solution:
Assign class B the responsibility to create an instance of
class A if one or more of the following is true:
B aggregates A objects
B contains instances of A objects
B has the initializing data that will be passed to A when it is
created.
B thus is the creator of A objects
Larman calls this the Creator principle
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 226
55. Who is the Creator?
55
Sale
-m_date
-m_time
1
contains
*
described by
Sales Detail Product
-quantity * -description
1 -price
Q: Who should have responsibility for creating the Sales Detail objects?
A: Since Sale aggregates Sales Detail, Sale should be the creator.
56. Design Guideline: Avoid Public
56
Fields
There should not be non-final public data members
Use properties/accessors and mutators (getters and
setters) instead.
In languages that support properties (VB.NET, C#), use
properties rather than getters and setters.
For boolean values, use naming convention IsAttr()
instead of getAttr()
57. Design Guideline: Prevent misuse by client
57
A well designed class should not allow a class to be
misused by its clients.
That is, mutators must ensure that data is being set correctly.
Parameters need to be checked for validity.
private ArrayList _room; How can this class be misused?
...
public Room getRoomByIndex(int index)
{
return (Room)_rooms.get(index);
}
private ArrayList _room; Solution #1
...
public Room getRoomByIndex(int index)
{
if (index >= 0 && index <= _rooms.size())
return (Room)_rooms.get(index);
else
return null;
}
58. Using Assertions
58
For languages (Java 1.4, C#) that support them, to help
catch future bugs, use assertions to detect violations at
run-time.
An assertion is a boolean condition that must evaluate to
true.
If the assertion is false, then an assertion exception is
thrown.
Most environments allow you to turn assertion checking on or off.
private ArrayList _room; Solution #2
...
public Room getRoomByIndex(int index)
{
assert index >= 0 && index <= _rooms.size();
if (index >= 0 && index <= _rooms.size())
return (Room)_rooms.get(index);
else
return null;
}`
59. Design Guideline: Establish invariants in
constructor
59
Invariants are data members that should not be modified in
a class after they have been established/initialized.
If a class uses mutators (setters) to establish an invariant, then it is
possible that future calls to the mutators will change the invariant.
Use a constructor to establish invariants.
60. Design Guideline: Establish invariants in constructor
60
public class Employee Using mutator to
{ establish invariant is
private int _key; unreliable.
public void setKey(int key){ _key = key; }
}
public class Employee Establish invariant
{ using constructor (java)
private int _key;
public Employee(int key){
_key = key;
}
public int getKey() { return _key; }
}
public class Employee Establish invariant
{ using constructor (C#)
private int _key;
public Employee(int key){
_key = key;
}
public int Key() {
get { return _key; }
}
61. Design Guideline: Refactor Duplicate Code Segments
61
Duplicate code segments are a maintenance
nightmare.
Code needs to be refactored so that code segments
occur only once.
62. Design Guideline: Refactor Duplicate Code Segments
62
Approaches:
Method invocation (duplication within single class)
Add a new method in same class that contains duplicate
code
Inheritance (duplication within multiple classes)
Place duplicate code in a method in superclass.
Won't work if classes already have separate existing
inheritance hierarchies.
Delegation (duplication within multiple classes)
Create separate class with public method that contains
duplicate code.
63. Design Guideline: Separate interface from
implementation
63
When the functionality in a class can be
implemented in different ways, separate the
interface from the implementation.
64. Design Guideline: Separate interface from
implementation
64
That is, use an interface to describe the interface; use
a class to describe the implementation.
This way, we could provide an alternate
implementation without disrupting existing code.
public class ArrayList implements List
public interface List {
{ public int size() { return ... }
public int size(); public boolean isEmpty()
public boolean isEmpty(); {
public void add(object item); ...
public object get(int index); }
... ...
} }
public class Vector implements List
{
public int size() { return ... }
public boolean isEmpty()
{
...
}
...
}
65. Design Guideline: Minimize Interface
Size
65
Try to design a class so that it provides the
functionality you need but whose public interface is
as small as possible.
Large numbers of methods and parameters often
indicate high levels of coupling and complexity.
Use objects to encapsulate a long list of parameters to
a method.
66. Design Guideline: Minimize Interface
66
Size
public Connection connectToDB(string driver, string connString, int accessRight, int ...)
{
...
}
Too big!
public Connection connectToDB(ConnectionInfo ci)
{
...
}
Just right!
public class ConnectionInfo
{
private string _driver;
private string _connString;
private int _accessRight;
...
}
67. Design Guideline: Program to
67
interface
When an interface is available, program to it rather
than to a particular concrete implementation.
Thisway, if in the future, a different implementation is
used, fewer changes will be required.
68. Design Guideline: Program to interface
68
private ArrayList _room = new ArrayList();
...
public ArrayList getRooms() public interface List
{ {
return _room; ...
} }
...
public class ArrayList implements List
Programming to implementation – will require more changes {
if we modify implementation in the future
...
}
private List _room = new ArrayList();
... public class LinkedList implements List
public List getRooms() {
{ ...
return _room; }
}
...
Programming to interface – more adaptable if we decide to use different
implementation in the future.
69. Design Guideline: Replace Conditionals with
Polymorphism
69
Problem:
How to handle alternative responsibilities based on type (i.e.,
conditional variation using if-then-else or case statements) ?
Problem with using conditional variation is that if a new variation
arises, it requires modification of the if-then-else structures, usually
in several places.
// constructor
Room public Room(int roomType) {
m_roomType = roomType
m_roomType
}
getRoomType() public String getRoomType() { less ideal
if (m_roomType == 1) return "Bedroom";
if (m_roomType == 2) return "Kitchen";
}
Room abc = new Room(1);
System.out.println( abc.getRoomType() );
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 326
70. Design Guideline: Replace Conditionals with
Polymorphism
70
Solution:
When related alternatives or behaviors vary by type (class), assign
responsibility for the behavior, using polymorphism, to the types for
which the behavior varies.
Thus, do not test for the type of an object and use conditional logic to
perform varying alternatives based on type.
public abstract String getRoomType();
Room
...
public String getRoomType() {
return "Bedroom";
getRoomType()
}
... better
public String getRoomType() {
return "Kitchen";
Bedroom Kitchen }
getRoomType() getRoomType() Kitchen abc = new Kitchen();
System.out.println( abc.getRoomType() );
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 326
71. Design Principle: Improve Cohesion or Coupling by Pure
Fabrication
71
Problem:
What object should have the responsibility, when the solution
offered by the Information Expert (for example) principle
violates High Cohesion or Low Coupling (or some other)
principles?
Solution:
Assign a highly cohesive set of responsibilities to an artificial
class with low coupling that does not represent a problem
domain concept.
Such a class is a pure fabrication of the designer's
imagination: it does not relate to anything in the problem
domain.
Larman calls this the Pure Fabrication principle.
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 329
72. Pure Fabrication
72
Suppose in our virtual street example, we wished to save our
Houses, Rooms, Persons and Items that the user input in a
database.
According to the information expert principle, who should be
responsible for saving, for instance, the Rooms entered by
the user?
According to the information expert principle, we should assign a
responsibility to the class that has the information necessary to
fulfill the responsibility.
Thus, according to the information expert principle, the Room class
should be responsible for saving its information to a database,
and the House class should be responsible for saving its
information to a database, etc.
73. Pure Fabrication
73
To save the information to a database may very well require a large
number of supporting database operations or methods, none related to the
concept of Room-ness or House-ness.
Thus, each of our domain classes become much less cohesive.
As well, each of our domain classes will become coupled to the database
interface (e.g., Java JDBC or Microsoft ADO).
Thus, each of our domain classes become highly coupled to something external.
To solve the problem, we need to make up (that is, to fabricate) a new class
that will handle the database tasks.
House Room Item
PersistantStorage
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 329
74. Design Principle: Indirection
74
Problem:
How to assign responsibility so as to avoid direct coupling
between two or more things.
How to de-couple objects so that low coupling is supported
and reuse potential is high?
Solution:
Assign the responsibility to an intermediate object to
mediate between other components so that they are not
directly coupled.
The intermediary creates an indirection between the other
components.
Larman calls this the Indirection principle.
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 332
75. Indirection
75
In our last example, the PersistantStorage
fabrication acts as an intermediary between the
domain objects and the database.
Many of the other patterns we will look at are
specializations of indirection.
"Most problems in computer science can be solved
by another level of indirection."
however, "Most problems in performance can be solved
by removing another layer of indirection" !
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 333
76. Design Principle: Don't Talk to
Strangers
76
Problem:
How to design classes that are protected from changes in
other class's interfaces?
That is, if an object has knowledge of the internal structure
of other objects, then it suffers from high coupling. How can
an object use a service from an indirect object without being
coupled to the internal structure of that object.
Solution:
Don't rely on another class's knowledge of other objects.
Instead, assign the responsibility to a client's direct object to
collaborate with an indirect object.
Larman calls this the Don't Talk to Strangers principle.
Source: Craig Larman, Applying UML and Patterns , 1st Edition (Prentice Hall, 1998), p. 400
77. Don't Talk to Strangers
// Returns the total number of holdings for the client
77
public int getNumHoldings(Client c)
{
int num = 0;
HoldingController for (int i=0; i<size(); i++)
{
m_holdings: Vector
Holding holding = m_holdings.get(i);
getNumHoldings(): int if ( c.getID() == holding.getClient().getID() )
num++;
}
Holding return num;
}
m_stock: Stock
m_client: Client
Message being sent to
getClient(): Client
getStock(): Stock
familiar object
(Holding) stranger object
(Client)
Client Stock
m_id: int m_symbol: String
m_name: String m_value: double
getID(): int getSymbol(): String
getName(): String getValue: double
itemName = house.getRoom(0).getItem(0).getName();
familiar object
(house) stranger object
(room) stranger object
(item)
78. Don't Talk to Strangers
78
Observe the following constraints on what objects you
should send messages to within a method:
the this object
a parameter of the method
an attribute of this
an element of a collection which is an attribute of this
an object created within the method
The intent of these constraints is to avoid coupling a
client to knowledge of indirect objects and the object
connections between objects.
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 336
79. If not to strangers, then who?
79
Following these constraints requires adding new public
operations to the "familiars" of an object.
// Returns the total number of holdings for the client
public int getNumHoldings(Client c)
{
int num = 0;
for (int i=0; i<size(); i++)
{
Holding holding = m_holdings.get(i);
if ( c.getID() == holding.getClientID() )
num++;
}
return num;
}
Of course, this may not seem worth the bother. Certainly, try
to avoid talking to a stranger of a stranger (e.g., second
example on last slide).
80. Design Principle: Be Cautious with Inheritance
80
Inheritance is a powerful way to use polymorphism and
reduce code duplication.
However, some potential problems with inheritance are
It is the strongest form of coupling
Encapsulation is weak within an generalization hierarchy
(changes in superclass ripple down to modify the
subclasses).
Inheritance relationships are fixed at run-time.
Sometimes aggregation is a better choice than an ill-
thought out inheritance hierarchy.
81. Example of Inheritance Problem
81
Employee
This looks okay, but it contains a semantic error. Can you see it?
Manager Programmer
Employee
«instance» Hint: What happens if we want to change
Manager Programmer Randy : Programmer Randy’s class to Manager at run-time?
Answer: is an employee just their job, or is a job a role that an employee has? That is, an
employee has a job. A job is a role that an employee has, it is not a “kind of” employee.
“Has a” indicates an aggregation relationship.
has a
Employee Job
1 *
Manager Programmer
Now we can promote an employee simply by
changing its job link at run-time.
Source: Arlow and Neustadt, UML and the Unified Process (Addison-Wesley, 2002), p. 265-6.
82. Design Principle: Delegation over class
inheritance
82
One way to deal with the problem of inheritance (weak
encapsulation of subclasses) is to favour object
composition and delegation over class inheritance if
code reuse is your only goal in using inheritance.
Use inheritance if there is a strong is a relationship;
otherwise, look at using object composition instead.
Rectangle
Rectangle
-width
-height -width
-height
+calculateArea()
+calculateArea()
Window
1
+open()
Window
+close() public int calculateArea()
-m_rect : Rectangle
{
Is there a strong “is a” relationship +open()
return m_rect.calculateArea();
+close()
between Rectangle and Window? +calculateArea() }
What happens when a new attribute, This uses object delegation instead to handle the
such as fill color, is added to Rectangle? calculateArea request; it is somewhat analogous to
Window will then inherit a characteristic letting the superclass handle the request, except here
which a Window does not have. the request is delegated to another object it contains.
83. What Next?
83
At this point, you should have detailed interaction
diagrams along with a detailed class diagram in which
responsibilities have been mapped to class methods.
Depending upon the software process being used, the
next step might be:
implement the classes defined in the class diagram and test.
Then refine the classes using design patterns as separate
iteration.
refine the classes in a second iteration through the design
phase using design patterns, then implement and test.
84. Mapping Design to Code
84
Your class diagram shows which methods and attributes
need to be implemented.
That is, by just looking at your class diagram, you can create
the attributes and the method stubs.
Your interaction diagrams show the messages that are
sent between objects in response to a method
invocation.
That is, they show how a given method or methods will be
implemented.
The sequence of these messages translates to a series of
statements in a method definition.
85. Order of Implementation
85
Classes need to be implemented (and ideally, fully
tested) from least-coupled to most-coupled.
This will typically mean that you will implement your
basic domain classes first.
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 311
86. Test-First Programming
86
On of the precepts of Extreme Programming (XP)
method is test-first programming, in which class
testing code is written before the code to be tested.
This ensures that testing gets done, but it also helps
clarify the design of the interfaces of a class.
This also creates a library of unit tests, which helps to
verify correctness of a system.
Source: Craig Larman, Applying UML and Patterns , 2nd Edition (Prentice Hall, 2001), p. 311