This document discusses the GRASP (General Responsibility Assignment Software Patterns) patterns Creator and Information Expert. It provides examples and explanations of when and how to apply these patterns to assign responsibilities in object-oriented design. The Creator pattern assigns the responsibility of creating a new instance of a class to the class that contains or closely uses the new instance. The Information Expert pattern assigns responsibility to the class that has the necessary information to fulfill that responsibility. Partial information experts may collaborate by sharing information through method calls. These patterns aim to achieve low coupling between classes.
This document discusses machine learning techniques for recommendations and clustering. It introduces recommendation algorithms that analyze user-item interaction data to find items users who interacted with one item also interacted with another. It also discusses techniques for fast, scalable clustering of large datasets including using a surrogate to quickly cluster data before applying a higher quality algorithm to cluster centroids. The document emphasizes that simple techniques like logging, counting and session analysis often work best at large scale and provides examples of using recommendations for queries, videos and music.
This document discusses applying GRASP (General Responsibility Assignment Software Patterns) principles to object-oriented design. It introduces five GRASP patterns: Creator, Information Expert, Controller, Low Coupling and High Cohesion. These patterns provide guidance on assigning responsibilities to classes in a way that promotes qualities like low coupling, high cohesion, and encapsulation. The document uses a board game example to illustrate applying the Creator and Information Expert patterns in UML class diagrams and sequence diagrams.
GRASP (General Responsibility Assignment Software Principles) is a set of principles for assigning responsibilities to classes, including Expert, Creator, Low Coupling, High Cohesion, Controller, Polymorphism, Pure Fabrication, and Indirection. The principles aim to minimize dependencies between classes, reduce impacts of design changes, and allow for variations without affecting dependent components. Following these principles can result in designs with well-defined responsibilities, low coupling, high cohesion, and flexibility to handle changes.
This document discusses the General Responsibility Assignment Software Patterns (GRASP) principles for object-oriented design. It begins with an introduction to GRASP and its goals of being a mental toolset for designing software. It then explains nine key GRASP design patterns - Informational Expert, Creator, Controller, Low Coupling, High Cohesion, Polymorphism, Pure Fabrication, Indirection, and Protected Variations. For each pattern, it provides a definition and example of how and when to apply the pattern when assigning responsibilities to classes. It concludes with references for further reading on GRASP patterns.
The document discusses the General Responsibility Assignment Software Patterns (GRASP) principles for assigning responsibilities to classes in object-oriented design. It outlines the 9 main GRASP principles - Information Expert, Creator, Low Coupling, Controller, High Cohesion, Polymorphism, Pure Fabrication, Indirection, and Protected Variations. For each principle, it provides the problem it addresses, the suggested solution, an example of how to apply the principle, and benefits and pros/cons. The principles provide guidance on how to distribute responsibilities among classes to achieve well-structured and maintainable object-oriented software designs.
The document discusses the key activities and deliverables of the inception phase of a project using the Unified Process (UP) methodology. The inception phase involves identifying business needs, creating a system vision, developing preliminary schedules and budgets, and performing initial risk analysis. Key tasks include developing a work breakdown structure, using tools like Microsoft Project to create a project schedule, and conducting a cost/benefit analysis to evaluate the financial feasibility of the project. The inception phase establishes the foundation for further iterations in developing the software system.
The document describes the requirements discipline which focuses on gathering information to define functional and non-functional system requirements through various techniques like interviews, observation, and prototypes. It discusses different types of models used like mathematical, descriptive, and graphical models including UML diagrams to reduce complexity and communicate requirements. Validation of requirements is done through prototypes or structured walkthroughs to ensure accuracy.
Operation contracts provide a pre-condition and post-condition format to precisely describe changes to objects in a domain model resulting from a system operation, serving as a more detailed specification than typical use cases. An operation contract defines the operation name and parameters, references relevant use cases, assumptions about the system state before execution, and importantly describes the resulting state of domain model objects after completion. Operation contracts are optional in the Unified Process and should only be used when use cases are insufficient for developers to understand system behavior.
GRASP (General Responsibility Assignment Software Patterns) is a set of principles for assigning responsibilities to classes and objects in software design. It describes nine patterns including creator, informational expert, controller, low coupling, high cohesion, and polymorphism. The patterns provide guidelines for assigning responsibilities to classes to achieve benefits like high cohesion, low coupling, and flexibility to changes. For example, the informational expert pattern suggests assigning a responsibility to the class that has the necessary information to fulfill it.
The document discusses the Unified Process (UP) as an iterative and adaptive system development methodology. It describes the traditional predictive systems development life cycle and explains when an adaptive approach may be better. The UP uses four phases of iterative development. It also describes object-oriented concepts, system development models, tools, and techniques that are part of the UP methodology.
This presentation is about a lecture I gave within the "Software systems and services" immigration course at the Gran Sasso Science Institute, L'Aquila (Italy): http://cs.gssi.infn.it/.
http://www.ivanomalavolta.com
The document summarizes the nine disciplines of the Rational Unified Process (RUP):
1) The Business Modeling Discipline involves understanding the business and domain model.
2) The Requirements Discipline involves eliciting, documenting, and agreeing on system requirements.
3) The Analysis and Design Discipline involves analyzing requirements and designing the system architecture and components.
4) The Implementation Discipline involves transforming the design into code and unit testing.
5) The Test Discipline involves defining and executing test plans and cases.
6) The Deployment Discipline involves planning and executing the system deployment.
7) The Configuration and Change Management Discipline involves managing versions and changes
The document discusses object-oriented analysis and design (OOAD) using the Unified Modeling Language (UML). It covers what OOAD is, different approaches to system analysis, object-oriented methodologies, the history and definition of UML, UML diagrams and modeling, and characteristics of a UML process. The chapter also includes an example ductwork estimating system case study.
The document provides an introduction to the Rational Unified Process (RUP). It discusses what a software engineering process is, limitations of the waterfall model, and an overview of RUP. RUP is an iterative software development process framework that is use case driven and architecture-centric. It consists of four main phases - inception, elaboration, construction, and transition - with milestones used to transition between phases. The goal is to deliver working software incrementally throughout the project lifetime.
The objective is to explain how a software design may be represented as a set of interacting objects that manage their own state and operations and to introduce various models that describe an object-oriented design.
The document discusses object-oriented analysis and design (OOAD), including an introduction to basic OO principles like encapsulation, abstraction, hierarchy, and modularity. It then covers various techniques for object-oriented analysis like noun lists and use cases. Finally, it discusses the process of transforming analysis models into design models using object-oriented design.
Object-oriented analysis and design (OOAD) is a popular approach for analyzing, designing, and developing applications using the object-oriented paradigm. It involves modeling a system as a group of interacting objects at various levels of abstraction. Key concepts in OOAD include objects, classes, attributes, methods, encapsulation, inheritance, polymorphism, and relationships like association, aggregation, and composition. Common OOAD techniques include use case diagrams, which show interactions between actors and the system, and class diagrams, which describe the structure and behavior of system objects and their relationships.
The document provides an overview of the Rational Unified Process (RUP). It discusses that the RUP is a software engineering process that guides software development organizations. The RUP is designed and delivered like software, with regular updates. It captures many modern best practices such as iterative development, managing requirements, and continuously verifying quality. The RUP has a defined structure using phases, iterations, and disciplines to group activities. It can also be customized to meet an organization's specific needs.
The document provides an overview of the Unified Software Process (UP). It discusses the history and development of UP over decades. Key aspects of UP include being use-case driven, architecture-centric, and iterative and incremental. UP recognizes four important aspects of software development: people, project, product, and process. Use cases drive the entire development process. UP emphasizes iterative development and producing incremental working software. The Rational Unified Process (RUP) provides additional tools and content to support applying UP.
What Does Big Data Mean and Who Will WinBigDataCloud
?
Michael Ralph Stonebraker is a computer scientist specializing in database research. He is currently an adjunct professor at MIT, where he has been involved in the development of the Aurora, C-Store, H-Store, Morpheus, and SciDB systems.Through a series of academic prototypes and commercial startups, Stonebraker's research and products are central to many relational database systems on the market today. He is also the founder of a number of database companies, including Ingres, Illustra, Cohera, StreamBase Systems, Vertica, VoltDB, and Paradigm4. He was previously the Chief Technical Officer (CTO) of Informix & a Professor of Computer Science at University of California, Berkeley. He is also an editor for the book "Readings in Database Systems"
This document discusses machine learning techniques for recommendations and clustering using Mahout. It begins with an introduction of the speaker and agenda. It then covers recommendations analysis using co-occurrence matrices and discusses using cross-occurrence matrices to recommend related items. It also discusses techniques for fast, scalable clustering including using surrogates and sketches to approximate data and speed up computations. Finally, it discusses parallelizing the algorithms and provides evaluation results for clustering quality.
Avatara: OLAP for Web-scale Analytics Products Lili Wu
?
We recently presented a paper about Avatara at VLDB 2012. Avatara is LinkedIn's scalable, low latency, and highly-available OLAP system for "sharded" multi-dimensional queries. It has been powering our analytical products, such as "Who's Viewed My Profile?" and "Who's Viewed This Job?", for two and a half years.
This document provides a quick tour of data mining. It begins with an overview of the evolution of data management techniques from manual record keeping to modern big data and data science. It then discusses what data mining is, focusing on algorithms for discovering patterns in existing data. Various examples of data mining applications are also presented, as well as the origins of data mining in fields such as machine learning and databases. Finally, an overview of the key steps in the knowledge discovery process is given, including data preprocessing, data mining, and pattern evaluation.
Every year the financial industry loses billions because of fraud while in the meantime fraudsters are coming up with more and more sophisticated patterns.
Financial institutions have to find the balance between fraud protection and negative customer experience. Fraudsters bury their patterns in lots of data, but the traditional technologies are not designed to detect fraud in real-time or to see patterns beyond the individual account.
Analyzing relations with graph databases helps uncover these larger complex patterns and speeds up suspicious behavior identification.
Furthermore, graph databases enable fast and effective real-time link queries and passing context to machine learning models.
The earlier fraud pattern or network is identified, the faster the activity is blocked. As a result, losses and fines are minimized.
Lens: Data exploration with Dask and Jupyter widgetsVíctor Zabalza
?
Lens is an open source Python library for automated data exploration of large datasets using Dask. It computes summary statistics and relationships between columns in a dataset. The results are serialized to JSON for interactive exploration through Jupyter widgets or a web UI. Dask allows the computations to run in parallel across a cluster for scalability. Lens integrates with the SherlockML platform to analyze all datasets uploaded.
1) Entity-centric data management stores and integrates information at the entity level rather than keywords or structured schemas. This allows for more natural integration of heterogeneous data as entities can be interlinked.
2) Techniques presented include ZenCrowd for crowdsourcing entity extraction, hybrid search to combine keyword and graph searches for entities, and Diplodocus for efficiently storing and querying entity data through clustering and co-location.
3) The approaches were shown to improve entity extraction precision by 14%, entity search results by up to 25%, and entity query performance by up to 300x compared to traditional techniques.
Operation contracts provide a pre-condition and post-condition format to precisely describe changes to objects in a domain model resulting from a system operation, serving as a more detailed specification than typical use cases. An operation contract defines the operation name and parameters, references relevant use cases, assumptions about the system state before execution, and importantly describes the resulting state of domain model objects after completion. Operation contracts are optional in the Unified Process and should only be used when use cases are insufficient for developers to understand system behavior.
GRASP (General Responsibility Assignment Software Patterns) is a set of principles for assigning responsibilities to classes and objects in software design. It describes nine patterns including creator, informational expert, controller, low coupling, high cohesion, and polymorphism. The patterns provide guidelines for assigning responsibilities to classes to achieve benefits like high cohesion, low coupling, and flexibility to changes. For example, the informational expert pattern suggests assigning a responsibility to the class that has the necessary information to fulfill it.
The document discusses the Unified Process (UP) as an iterative and adaptive system development methodology. It describes the traditional predictive systems development life cycle and explains when an adaptive approach may be better. The UP uses four phases of iterative development. It also describes object-oriented concepts, system development models, tools, and techniques that are part of the UP methodology.
This presentation is about a lecture I gave within the "Software systems and services" immigration course at the Gran Sasso Science Institute, L'Aquila (Italy): http://cs.gssi.infn.it/.
http://www.ivanomalavolta.com
The document summarizes the nine disciplines of the Rational Unified Process (RUP):
1) The Business Modeling Discipline involves understanding the business and domain model.
2) The Requirements Discipline involves eliciting, documenting, and agreeing on system requirements.
3) The Analysis and Design Discipline involves analyzing requirements and designing the system architecture and components.
4) The Implementation Discipline involves transforming the design into code and unit testing.
5) The Test Discipline involves defining and executing test plans and cases.
6) The Deployment Discipline involves planning and executing the system deployment.
7) The Configuration and Change Management Discipline involves managing versions and changes
The document discusses object-oriented analysis and design (OOAD) using the Unified Modeling Language (UML). It covers what OOAD is, different approaches to system analysis, object-oriented methodologies, the history and definition of UML, UML diagrams and modeling, and characteristics of a UML process. The chapter also includes an example ductwork estimating system case study.
The document provides an introduction to the Rational Unified Process (RUP). It discusses what a software engineering process is, limitations of the waterfall model, and an overview of RUP. RUP is an iterative software development process framework that is use case driven and architecture-centric. It consists of four main phases - inception, elaboration, construction, and transition - with milestones used to transition between phases. The goal is to deliver working software incrementally throughout the project lifetime.
The objective is to explain how a software design may be represented as a set of interacting objects that manage their own state and operations and to introduce various models that describe an object-oriented design.
The document discusses object-oriented analysis and design (OOAD), including an introduction to basic OO principles like encapsulation, abstraction, hierarchy, and modularity. It then covers various techniques for object-oriented analysis like noun lists and use cases. Finally, it discusses the process of transforming analysis models into design models using object-oriented design.
Object-oriented analysis and design (OOAD) is a popular approach for analyzing, designing, and developing applications using the object-oriented paradigm. It involves modeling a system as a group of interacting objects at various levels of abstraction. Key concepts in OOAD include objects, classes, attributes, methods, encapsulation, inheritance, polymorphism, and relationships like association, aggregation, and composition. Common OOAD techniques include use case diagrams, which show interactions between actors and the system, and class diagrams, which describe the structure and behavior of system objects and their relationships.
The document provides an overview of the Rational Unified Process (RUP). It discusses that the RUP is a software engineering process that guides software development organizations. The RUP is designed and delivered like software, with regular updates. It captures many modern best practices such as iterative development, managing requirements, and continuously verifying quality. The RUP has a defined structure using phases, iterations, and disciplines to group activities. It can also be customized to meet an organization's specific needs.
The document provides an overview of the Unified Software Process (UP). It discusses the history and development of UP over decades. Key aspects of UP include being use-case driven, architecture-centric, and iterative and incremental. UP recognizes four important aspects of software development: people, project, product, and process. Use cases drive the entire development process. UP emphasizes iterative development and producing incremental working software. The Rational Unified Process (RUP) provides additional tools and content to support applying UP.
What Does Big Data Mean and Who Will WinBigDataCloud
?
Michael Ralph Stonebraker is a computer scientist specializing in database research. He is currently an adjunct professor at MIT, where he has been involved in the development of the Aurora, C-Store, H-Store, Morpheus, and SciDB systems.Through a series of academic prototypes and commercial startups, Stonebraker's research and products are central to many relational database systems on the market today. He is also the founder of a number of database companies, including Ingres, Illustra, Cohera, StreamBase Systems, Vertica, VoltDB, and Paradigm4. He was previously the Chief Technical Officer (CTO) of Informix & a Professor of Computer Science at University of California, Berkeley. He is also an editor for the book "Readings in Database Systems"
This document discusses machine learning techniques for recommendations and clustering using Mahout. It begins with an introduction of the speaker and agenda. It then covers recommendations analysis using co-occurrence matrices and discusses using cross-occurrence matrices to recommend related items. It also discusses techniques for fast, scalable clustering including using surrogates and sketches to approximate data and speed up computations. Finally, it discusses parallelizing the algorithms and provides evaluation results for clustering quality.
Avatara: OLAP for Web-scale Analytics Products Lili Wu
?
We recently presented a paper about Avatara at VLDB 2012. Avatara is LinkedIn's scalable, low latency, and highly-available OLAP system for "sharded" multi-dimensional queries. It has been powering our analytical products, such as "Who's Viewed My Profile?" and "Who's Viewed This Job?", for two and a half years.
This document provides a quick tour of data mining. It begins with an overview of the evolution of data management techniques from manual record keeping to modern big data and data science. It then discusses what data mining is, focusing on algorithms for discovering patterns in existing data. Various examples of data mining applications are also presented, as well as the origins of data mining in fields such as machine learning and databases. Finally, an overview of the key steps in the knowledge discovery process is given, including data preprocessing, data mining, and pattern evaluation.
Every year the financial industry loses billions because of fraud while in the meantime fraudsters are coming up with more and more sophisticated patterns.
Financial institutions have to find the balance between fraud protection and negative customer experience. Fraudsters bury their patterns in lots of data, but the traditional technologies are not designed to detect fraud in real-time or to see patterns beyond the individual account.
Analyzing relations with graph databases helps uncover these larger complex patterns and speeds up suspicious behavior identification.
Furthermore, graph databases enable fast and effective real-time link queries and passing context to machine learning models.
The earlier fraud pattern or network is identified, the faster the activity is blocked. As a result, losses and fines are minimized.
Lens: Data exploration with Dask and Jupyter widgetsVíctor Zabalza
?
Lens is an open source Python library for automated data exploration of large datasets using Dask. It computes summary statistics and relationships between columns in a dataset. The results are serialized to JSON for interactive exploration through Jupyter widgets or a web UI. Dask allows the computations to run in parallel across a cluster for scalability. Lens integrates with the SherlockML platform to analyze all datasets uploaded.
1) Entity-centric data management stores and integrates information at the entity level rather than keywords or structured schemas. This allows for more natural integration of heterogeneous data as entities can be interlinked.
2) Techniques presented include ZenCrowd for crowdsourcing entity extraction, hybrid search to combine keyword and graph searches for entities, and Diplodocus for efficiently storing and querying entity data through clustering and co-location.
3) The approaches were shown to improve entity extraction precision by 14%, entity search results by up to 25%, and entity query performance by up to 300x compared to traditional techniques.
This document provides an overview of the CSE42D: Data Structures course. It introduces common data structures like queues and stacks. The goals of the course are to learn fundamental data structures, improve algorithmic problem solving skills, and gain proficiency with UNIX and X-windows. Common data structures are presented, including arrays, linked lists, trees, queues and stacks. Queues and stacks are defined as abstract data types and implementations like circular arrays and linked lists are discussed.
The document summarizes lessons learned from 100 Exadata implementations by Enkitec, an Oracle consulting partner. It discusses Exadata configurations, performance improvements, common migration strategies, and customer use cases. Typical Exadata implementations see performance improvements of 2-140x and consolidation of 31 servers onto a single Exadata quarter rack. Questions are welcomed.
Dale Smith, Data Scientist, Nexidia at MLconf ATL - 9/18/15MLconf
?
Tensor Decompositions and Machine Learning: We know about vectors and matrices (linear transformations) from Linear Algebra. But tensors are not so familiar. Think of a hypercube in your data warehouse – can you do a tensor decomposition into lower-rank objects that reveal hidden features or hierarchies?
Neo4j: What's Under the Hood & How Knowing This Can Help You Neo4j
?
Neo4j provides a concise summary of how graph databases have evolved and their advantages over traditional databases. Specifically, graph databases can handle billions of connections between data points and enable queries that can traverse thousands of relationships between nodes, providing answers in milliseconds rather than minutes. This level of connected data insight allows for real-time fraud detection, recommendations, knowledge graphs, and other applications that require understanding relationships in large, dynamic datasets.
Using Deep Learning to do Real-Time Scoring in Practical ApplicationsGreg Makowski
?
http://www.meetup.com/SF-Bay-ACM/events/227480571/
(see also YouTube for a recording of the presentation)
The talk will cover a brief review of neural network basics and the following types of neural network deep learning:
* autocorrelational - unsupervised learning for extracting features. He will describe how additional layers build complexity in the feature extraction.
* convolutional - how to detect shift invariant patterns in various data sources. Horizontal shift invariant detection applies to signals like speech recognition or IoT data. Horizontal and vertical shift invariance applies to images or videos, for faces or self driving cars
* discuss details of applying deep net systems for continuous or real time scoring
* reinforcement learning or Q Learning - such as learning how to play Atari video games
* continuous space word models - such as word2vec, skipgram training, NLP understanding and translation
Teradata Partners Conference Oct 2014 Big Data Anti-PatternsDouglas Moore
?
Douglas Moore discusses common anti-patterns seen when implementing big data solutions based on lessons learned from working with over 50 clients. He covers anti-patterns in hardware and infrastructure like relying on outdated reference architectures, tooling like trying to do analytics directly in NoSQL databases, and big data warehousing like over-curating data during ETL. The key is to understand the strengths and weaknesses of different tools and deploy the right solution for the intended workload.
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...Wes McKinney
?
This document discusses pandas, a popular Python library for data analysis, and its limitations. It introduces Badger, a new project from DataPad that aims to address some of pandas' shortcomings like slow performance on large datasets and lack of tight database integration. The creator describes Badger as using compressed columnar storage, immutable data structures, and C kernels to perform analytics queries much faster than pandas or databases on benchmark tests of a multi-million row dataset. He envisions Badger becoming a distributed, multicore analytics platform that can also be used for ETL jobs.
DataStax | Network Analysis Adventure with DSE Graph, DataStax Studio, and Ti...DataStax
?
Ride along as we use network analysis techniques to derive insights from our graph. We will begin by using exploratory analysis techniques to develop a high level understanding of our data. After gaining familiarity in the aggregate, we will select key elements of the graph for detailed inspection and graph visualization.
We will explore fundamental techniques that bridge the gap between academic network analysis concepts and pragmatic problem solving approaches for real-world property graphs at scale.
Prior network analysis expertise is not required. Source code and reproducibles will be made publicly available. Please try this at home.
About the Speaker
Bob Briody Software Engineer, DataStax
Bob is a diverse developer with over 10 years of experience across the stack. He joined DataStax as part of the Aurelius acquisition in 2015. Since then he has contributed to the design and development of DataStax Studio, with a focus on graph interaction and visualization. Bob is also a contributor to the Apache TinkerPop project.
This document discusses building a data mesh architecture using event streaming with Confluent. It begins by introducing the concept of a data mesh and its four key principles: domain ownership, treating data as a product, self-serve data platforms, and federated computational governance. It then explains how event streaming is well-suited for a data mesh approach due to properties like scalability, immutability, and support for microservices. The document outlines a practical example of domain teams managing their own data products. It emphasizes that implementing a full data mesh is a journey and recommends starting with the first principle of domain ownership. Finally, it positions Confluent as a central platform that can help coordinate domains and easily connect applications and data systems across clouds
1. GRASP — General Responsibility
Assignment Software Patterns
Object Oriented Analysis and Design
Aron Trauring
T++ Technical Skills Training Program
CUNY Institute for Software Design & Development (CISDD)
New York Software Industry Association (NYSIA)
December 17th, 2004
Aron Trauring — Zoteca
2. T++ — CISDD — NYSIA GRASP - OOAD
Mini Exercise 1 Who will create Square object in
Monopoly? (Use DM Larman p.158)
Aron Trauring — Zoteca 1
3. T++ — CISDD — NYSIA GRASP - OOAD
Solution (Larman p. 283)
? Have no design model so start with Domain Model
? Low representational gap — build design model (dynamic and static)
? He who knows is responsible
Aron Trauring — Zoteca 2
4. T++ — CISDD — NYSIA GRASP - OOAD
Creator
Creator
Problem: Who should be responsible for creating a new instance of some class?
Solution: Assign class B the responsibility to create an instance of class A if
one of these is true:
1. B “contains” or compositely aggregates A
2. B records A
3. B closely uses A
Aron Trauring — Zoteca 3
5. T++ — CISDD — NYSIA GRASP - OOAD
4. B has the initializing data for A that will be passed to A when it is created (B
is an expert w.r.t. A)
If more than one applies, prefer a class B that meets criterion 1.
Aron Trauring — Zoteca 4
7. T++ — CISDD — NYSIA GRASP - OOAD
Creator — When Not to Use
? When want to reuse existing instances for performance purposes (caching)
? Really need instance of subclass base on some external criteria
? Other more complex situations
? Delegate responsibility further down
Aron Trauring — Zoteca 6
8. T++ — CISDD — NYSIA GRASP - OOAD
Creator — Bene?ts
? Existing associations means created class is in any case visible to creator
? High cohesion
? Does not increase coupling
Aron Trauring — Zoteca 7
9. T++ — CISDD — NYSIA GRASP - OOAD
Mini Exercise 2 — Given a key, which object can tell
me about
? Square in Monopoly
? LineItem in Example DCD
? Total in same example
Aron Trauring — Zoteca 8
10. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert
Information Expert
Problem: What is a general principle of assigning responsibility to objects?
Solution: Assign responsibility to the class that has the information necessary
to ful?ll responsibility
Aron Trauring — Zoteca 9
11. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert — How to?
1. Clearly state the responsibility
2. Look in Design Model for relevant classes
3. Else look in Domain Model and create design classes
Aron Trauring — Zoteca 10
12. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert — Sale Total Example
? Who should know the grand total of a sale?
? Product has information about Price so it is expert for that (getPrice
method)
? LineItems has information about Product and Quantity so it is expert for
PriceTotal (getPriceTotal method)
? Sale has information LineItems with associated PriceTotal so it is expert
for SaleTotal (getSaleTotal method)
Aron Trauring — Zoteca 11
15. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert — Sample Code Model
? Might be simpler to show in code
Aron Trauring — Zoteca 14
16. T++ — CISDD — NYSIA GRASP - OOAD
Partial Information Expert
? Ful?lling responsibility may require information spread across di?erent classes
? Partial information experts collaborate in task — getSaleTotal example
? Interact through messages (methods) to share the work
Aron Trauring — Zoteca 15
17. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert — ”Real World” Analogy
? “Do It Myself” [Coad] or “Animation” [Larman] principle — objects are “alive”
and can do things themselves
? “Those who know do”
? Ultimate knowledge may require co-operation
Aron Trauring — Zoteca 16
18. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert — When Not to Use
? When violate low coupling and high cohesion goals
? Product does not look up its price and description directly — Application
Logic vs. Technical Services (Database)
? Sale does not save itself in database
? Knowing about Database services would lower cohesion and increase cross-layer
coupling
? “Separation of Major Concerns” principle — architectural issue
Aron Trauring — Zoteca 17
19. T++ — CISDD — NYSIA GRASP - OOAD
Information Expert — Bene?ts
? Encapsulation — objects support their own information — supports low
coupling
? Behavior is distributed across classes — supports high cohesion
Aron Trauring — Zoteca 18
20. T++ — CISDD — NYSIA GRASP - OOAD
Mini-Exercise 3 Who creates the Payment?
? makePayment method invoked in Register
? A Payment has to be associated with the Sale
? Who creates the Payment instance?
Aron Trauring — Zoteca 19
24. T++ — CISDD — NYSIA GRASP - OOAD
Coupling
Measure of how strongly one element is:
1. connected to
2. has knowledge of
3. relies on
another element
Aron Trauring — Zoteca 23
25. T++ — CISDD — NYSIA GRASP - OOAD
Problems with High Coupling
? Forced local changes because of changes in related class
? Harder to understand in isolation
? Harder to reuse — drags in more classes
Aron Trauring — Zoteca 24
26. T++ — CISDD — NYSIA GRASP - OOAD
Low Coupling
Low Coupling
Problem: How to support low dependency, low change impact and increased
reuse?
Solution: Assign responsibility so coupling remains low. Use this principle to
evaluate alternatives
All other things being equal prefer the low coupling solution
Note: Information Expert encourages Low Coupling
Aron Trauring — Zoteca 25
27. T++ — CISDD — NYSIA GRASP - OOAD
Types of Coupling
? ClassX has an attribute (data member or instance variable) that refers to
ClassY or ClassY instance
Sale contains Orderline
? ClassX object calls on services of a ClassY object
Product calls ProductCatalog.lookupPrice(itemID)
? ClassX has a method that references ClassY or ClassY instance
In Orderline:
Aron Trauring — Zoteca 26
28. T++ — CISDD — NYSIA GRASP - OOAD
def getPriceTotal(self):
return (self.product.getPrice() * self.quantity)
? ClassX is a direct or indirect subclass of ClassY
Class PizzaBot(Chef)
? ClassX is an interface, and ClassY implements that interface
Lamp.Turnon
Aron Trauring — Zoteca 27
29. T++ — CISDD — NYSIA GRASP - OOAD
Low Coupling — Observations
? Evaluative principle — needs to be considered in context of other principles
? Measure current degree of coupling and assess “damage” of increasing
? Example: Tradeo?s between bene?ts of sub-classing and increased coupling
? Generic classes with high probability of reuse should have low coupling
? Try not be highly coupled to unstable parts of system if can
Aron Trauring — Zoteca 28
30. T++ — CISDD — NYSIA GRASP - OOAD
Low Coupling — When Not To
? Too little coupling means we aren’t a “collaborating community of objects”
? It’s ok to be highly coupled with stable or pervasive elements (e.g. language
libraries)
Aron Trauring — Zoteca 29
31. T++ — CISDD — NYSIA GRASP - OOAD
Low Coupling — Bene?ts
? Not a?ected by changes in other components
? Simple to understand in isolation
? Convenient to reuse
Aron Trauring — Zoteca 30
32. T++ — CISDD — NYSIA GRASP - OOAD
Controller — Understanding the Problem
? SSD — boundary between the User and SUD
? UI layer “catches” the request
? The request is a system operation — public interface
? Model-View Separation principle says UI must not contain business logic
? Problem: to which domain layer object should the UI pass the system operation?
Aron Trauring — Zoteca 31
33. T++ — CISDD — NYSIA GRASP - OOAD
Mini Exercise 1 — Lahrman p. 288 — Which object
starts the game?
Aron Trauring — Zoteca 32
34. T++ — CISDD — NYSIA GRASP - OOAD
Controller
Controller
Problem: What ?rst object beyond the UI layer receives and co-ordinates
(controls) a system operation
Solution: Assign the responsibility to a class representing one of the following
choices:
1. Facade Controller : represents the overall system, a root object, a device that
the object is running within, or a major sub-system
2. Use Case or Session Controller : represents a use case scenario within which
the system event occurs
Aron Trauring — Zoteca 33
35. T++ — CISDD — NYSIA GRASP - OOAD
Session Controllers
? Naming conventions: <UseCaseName>Handler or <UseCaseName>CoOrdinator
or <UseCaseName>Session
? Use same controller class for all system operations in the use case scenario
? Session is a type of conversation between the actor and the SUD
Aron Trauring — Zoteca 34
36. T++ — CISDD — NYSIA GRASP - OOAD
Mini Exercise 1 — Solution on pp. 288-9
Aron Trauring — Zoteca 35
37. T++ — CISDD — NYSIA GRASP - OOAD
Controller — NextGen POS Example
? Conceptual representation — what is the the class that handles these opera-
tions?
Aron Trauring — Zoteca 36
41. T++ — CISDD — NYSIA GRASP - OOAD
Controller — Observations
? Delegation pattern
? External input events may come from human actors or other systems
? Facade — the “face” of the domain layer to the world
Ex: Register
? Handler — deals with a clear cut part of the issue
Ex: ProcessSale
? Session — conversation where information needs to be retained between steps
Aron Trauring — Zoteca 40
42. T++ — CISDD — NYSIA GRASP - OOAD
Ex: identify out of sequence EndSale before MakePayment
Aron Trauring — Zoteca 41
43. T++ — CISDD — NYSIA GRASP - OOAD
Controller — Facade
? “cover” over the other layers of the application
? Abstraction of an overall physical unit — Register, PizzaShop
? The entire software system — POSSystem
? Abstraction of some other overall system or sub-system concept —
MonopolyGame
? Suitable for relatively small systems and/or system with limited number of
system operations
? Suitable in message handling system when can’t direct messages to alternative
controllers — Internet application servers
Aron Trauring — Zoteca 42
44. T++ — CISDD — NYSIA GRASP - OOAD
Controller — Use Case
? Pure Fabrication — ProcessSaleHandler in not a domain concept in
Domain Model
? When assigning to facade may lead to high coupling or low cohesion (“Bloat”)
? Many system operations across di?erent processes
? Conceptually easier to understand and build
Aron Trauring — Zoteca 43
45. T++ — CISDD — NYSIA GRASP - OOAD
Controller vs. UI
? UI should not have responsibility for ful?lling system operations
? System operations handled in domain layer
? Controller is responsible for forwarding messages on
Aron Trauring — Zoteca 44
46. T++ — CISDD — NYSIA GRASP - OOAD
Controller — Bene?ts
? Allows for easy change of UI and/or alternative UI and/or Batch mode
? Allows for reuse of domain layer code (UI is usually application speci?c)
? Helps ensure sequence of operation which may di?er from UI input
? Can reason about system state — UI does not preserve state
Aron Trauring — Zoteca 45
47. T++ — CISDD — NYSIA GRASP - OOAD
Bloated Controllers — The Problem
? Low cohesion — unfocused and handling too many areas of responsibility:
? When have a facade controller handling all of many system events
? When the controller performs many of the system operations instead of
delegating
? When the controller has many attributes (much information) about the system
which should be distributed to or duplicates from elsewhere
Aron Trauring — Zoteca 46
48. T++ — CISDD — NYSIA GRASP - OOAD
Bloated Controllers — The Solution
? Add more controllers — use case instead of facade
? Design the controller so that it delegates operations to other objects
? High Cohesion is itself a GRASP principle
Aron Trauring — Zoteca 47
50. T++ — CISDD — NYSIA GRASP - OOAD
Cohesion De?ned
? measure of how strongly related and focused the responsibilities of an object
are
? Goal: highly related responsibilities
? Goal: small number of responsibilities
Aron Trauring — Zoteca 49
51. T++ — CISDD — NYSIA GRASP - OOAD
Low Cohesion — The Problem
? Hard to understand
? Hard to rescue
? Hard to maintain
? Subject to constant need to change (usually high coupling)
Aron Trauring — Zoteca 50
52. T++ — CISDD — NYSIA GRASP - OOAD
High Cohesion
High Cohesion
Problem: How to keep objects focused, understandable and manageable, and
as a side e?ect support Low Coupling?
Solution: Assign responsibility so cohesion remains high.
Dosage: Use as an evaluation tool
Aron Trauring — Zoteca 51
53. T++ — CISDD — NYSIA GRASP - OOAD
High Cohesion — NextGen POS Example
? Register creates Payment in real world, so by Creator should in software too
? Danger: Register might start taking on too many responsibilities
? One step in isolation might not be a problem but adding up will lead to low
cohesion
Aron Trauring — Zoteca 52
54. T++ — CISDD — NYSIA GRASP - OOAD
? Delegating to Sale creates greater cohesion in Register
? Second example also has lower coupling, so therefore more desirable on that
score
Aron Trauring — Zoteca 53
55. T++ — CISDD — NYSIA GRASP - OOAD
High Cohesion — Observations
? Real world analogy: Delegate responsibility
? Highly related to low coupling
? Needs to be used in conjunction with other principles
Aron Trauring — Zoteca 54
56. T++ — CISDD — NYSIA GRASP - OOAD
High Cohesion — When Not to
? Class that needs to be maintained by a specialist — group functions by area
of expertise (SQL queries)
? Performance issues demand grouping a set of operations together — RPC
Aron Trauring — Zoteca 55
57. T++ — CISDD — NYSIA GRASP - OOAD
High Cohesion — Bene?ts
? Clarity and ease of comprehension of design increased
? Maintenance and enhancements are simpli?ed
? Low coupling is often supported
? Enhances reuse
Aron Trauring — Zoteca 56