This presentation talks about the five SOLID principles of Object Oriented Design described by Rober C. Martin in his best-seller book "Agile Principles, Patterns, and Practices in C#". The five principle described are:
- Single Responsibility Principle
- Open-Close Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Business intelligence (BI) focuses on analyzing past business data to provide insights for decision-making, while data science aims to predict future trends through analyzing patterns in data using machine learning and other advanced analytics techniques. BI uses structured data to identify strengths and weaknesses, while data science can leverage both structured and unstructured data to develop forecasts. Data science requires stronger technical skills than BI and can manage more dynamic data sources.
This document provides an introduction to big data analytics and data science, covering topics such as the growth of data, what big data is, the emergence of big data tools, traditional and new data management architectures including data lakes, and big data analytics. It also discusses roles in data science including data scientists and data visualization.
The goal of this workshop is to introduce fundamental capabilities of R as a tool for performing data analysis. Here, we learn about the most comprehensive statistical analysis language R, to get a basic idea how to analyze real-word data, extract patterns from data and find causality.
Backtracking is a problem-solving technique that incrementally builds candidates to the solutions, and abandons each partial candidate ("backtracks") as soon as it determines that the candidate cannot possibly be completed to a valid solution. This document provides an overview of backtracking algorithms, including their history, how they work, examples of problems they can solve like the n-queens problem, advantages like finding optimal solutions, disadvantages like slow runtimes, and time complexities that depend on the specific problem.
This document provides an overview of HTTP and REST APIs. It describes how HTTP allows sending documents over the web using URLs to identify resources and HTTP verbs like GET, PUT, DELETE and POST. It defines common response codes. It explains that REST stands for Representational State Transfer and relies on a stateless, client-server architecture using the HTTP protocol. The key design constraints of REST include having a uniform interface, being resource-based and using representations to manipulate resources with self-descriptive messages. Benefits include statelessness for scalability, cacheability to improve performance, separating clients from servers, and using a layered system with intermediary servers.
This document provides an introduction to the Unified Modeling Language (UML). It defines UML as a standard modeling language used to visualize, specify, construct and document software systems. The document outlines the basics of UML including common diagram types like use case diagrams, class diagrams and sequence diagrams. It also discusses modeling tools that support working with UML diagrams.
The document provides an introduction and overview of design patterns. It defines design patterns as common solutions to recurring problems in software design. The document discusses the origin of design patterns in architecture, describes the four essential parts of a design pattern (name, problem, solution, consequences), and categorizes patterns into creational, structural, and behavioral types. Examples of commonly used patterns like Singleton and State patterns are also presented.
This document discusses requirements engineering for software systems. It covers topics such as functional and non-functional requirements, the software requirements document, requirements specification processes, and requirements elicitation, validation, and management. It describes requirements engineering as establishing customer needs and operational constraints. Requirements can range from abstract to detailed and serve different purposes. Both functional and non-functional requirements are important, and natural language, structured, and other techniques can be used for specification.
The theory of SOLID principles was
introduced by Robert C. Martin in his 2000
paper “Design Principles and Design
Patterns”.
SOLID => Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion.
The document discusses design patterns. It begins with an introduction to design patterns, covering their history and definition. It then covers several fundamental design principles for patterns, including avoiding tight coupling, favoring composition over inheritance, and the single responsibility principle. Finally, it discusses several specific design patterns, including factory method, singleton, strategy, state, and proxy patterns. It provides examples of when and how to apply these patterns.
This document discusses design principles for writing maintainable code, including the SOLID principles. It describes symptoms of bad design like rigidity, fragility, immobility and viscosity. It then explains each SOLID principle in detail: single responsibility principle, open closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle. For each principle, it provides examples of how to apply the principle correctly and the benefits it provides, such as making code easier to change and reuse.
Software engineering - Topics and Research AreasTechsparks
This document provides an overview of key topics in software engineering including the software development life cycle (SDLC), common software development models, software testing, the unified modeling language (UML), software maintenance, and case tools. It also outlines potential thesis, research, and project topics such as data modeling, UML, SDLC methodologies, software quality, and software project management. The document introduces software engineering principles and describes why software engineering practices are required to manage large, complex software projects and products.
This document discusses the design of a document editor called Lexi. It addresses several design problems including document structure, formatting, user interface embellishment, supporting multiple look-and-feel standards and window systems, and user operations like undo/redo. It proposes solutions to these problems using several design patterns like composite, decorator, factory, bridge, command, and iterator patterns to achieve flexibility, extensibility and independence of algorithms and structures. The goal is to create a reusable and extensible design that can be understood and communicated effectively between team members.
This document provides an overview of design patterns including their definition, utility, essential elements, and examples. It discusses creational patterns like singleton, factory, and builder. Structural patterns covered include adapter, proxy, and composite. Behavioral patterns like command and iterator are also introduced. The document is presented as a slideshow by Dr. Lilia Sfaxi on design patterns for software engineering.
The document summarizes a presentation on test automation with Cucumber-JVM. Cucumber allows writing tests in plain text and executing them as automated tests. It supports behavior driven development by writing specifications in a natural language format. Cucumber tests can be written in various programming languages like Java, Ruby, and executed using JUnit. It uses regular expressions and annotations to map steps in feature files to code implementations.
The Single Responsibility Principle (SRP) is one of the 5 SOLID principles. These slides gives you an overview of the principle as well as a refactoring from a non-SRP code to a SRP-code.
Youtube Link: https://youtu.be/DFbhpQpqyuo
** Android Certification Training: https://www.edureka.co/android-development-certification-course **
This Edureka ppt on "Android SDK Tutorial" (Blog Series: http://bit.ly/2MJ6zbc ) will help you understand how Android SDK works.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Refactoring for Software Design Smells - 1 day Workshop Ganesh Samarthyam
The document discusses various design smells that negatively impact software quality attributes like reusability, changeability, understandability and extensibility. It covers different categories of design smells including abstraction smells, encapsulation smells and modularization smells. Some examples of specific smells discussed are missing abstraction, leaky encapsulation, broken modularization etc. The document emphasizes the importance of addressing design smells through refactoring to improve design quality and reduce technical debt.
This document provides an overview of the SOLID principles of object-oriented design:
- SOLID is an acronym that stands for five design principles introduced by Robert C. Martin. The principles are Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
- Applying these principles helps make software more maintainable, reusable, and understandable by reducing coupling between modules and increasing cohesion within modules. This addresses issues like rigidity, fragility, and immobility that make code difficult to change over time.
- The principles should be applied when refactoring existing code that shows signs of rot, such as code smells, in order to remove these
This document discusses design patterns, beginning with how they were introduced in architecture in the 1950s and became popularized by the "Gang of Four" researchers. It defines what patterns are and provides examples of different types of patterns (creational, structural, behavioral) along with common patterns in each category. The benefits of patterns are that they enable reuse, improve communication, and ease the transition to object-oriented development. Potential drawbacks are that patterns do not directly lead to code reuse and can be overused. Effective use requires applying patterns strategically rather than recasting all code as patterns.
Class object method constructors in javaRaja Sekhar
Presented By :
N.V.Raja Sekhar Reddy
www.technolamp.co.in
www.programming9.com
Want more interesting...
Watch and Like us @ https://www.facebook.com/Technolamp.co.in
subscribe videos @ http://www.youtube.com/user/nvrajasekhar
The document discusses software processes and iterative process models. It describes incremental delivery and spiral development as two iterative process models. Incremental delivery breaks development into increments with each delivering part of the functionality. Spiral development represents the process as a spiral with phases addressing objectives, risks, development and planning. Both models allow for iteration and incorporate user feedback earlier.
A quick-and-dirty introduction to Design Smells, as presented in Robert 'Uncle Bob' Martin book "Agile Software Development". Thought as the first of a series.
Albiorix Technology is sharing the top mobile app development frameworks that you can use for mobile app development. It will help you make the app development process easier for your next app development project.
For More Information: https://www.albiorixtech.com/blog/mobile-app-development-frameworks/
#MobileApp #AppDevelopment #WebAppDevelopment #MobileAppDevelopment #SoftwareDevelopment
Encapsulation is one of the fundamental concepts of object-oriented programming (OOP). It refers to bundling data and methods that operate on that data within a class. This hides the values and state of the data from outside usage. Encapsulation helps bind data and functions together, hides data from direct access, and makes code more flexible and maintainable by allowing changes without affecting other code. The benefits of encapsulation include increased reusability, reduced complexity by hiding implementation details, and extensibility by allowing updates without changing input/output formats.
Code quality is important to ensure code is easy to understand, maintain and extend. Key aspects of code quality include having high test coverage, following design principles like SOLID, and using metrics like maintainability index and technical practices such as pair programming, code reviews, refactoring and test-driven development. Tools like Visual Studio and Resharper can help analyze code quality metrics and identify areas for improvement.
The document provides an introduction to object oriented programming in C# and covers key concepts such as classes, objects, encapsulation, methods, constructors, static members, and partial classes. It includes examples to demonstrate how to define classes, create objects, control access to class members, pass objects to methods, and divide class definitions across multiple files. The overall goal is to help readers understand the basic principles of OOP in C# and how to write and use classes and objects in programs.
Good quality code is an essential property of a software because it could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.
Errori comuni nei documenti di Analisi dei RequisitiRiccardo Cardin
This presentation talks about common errors that I found in my career in documents of specification of requirements. In the presentation are described common errors on use cases, use cases' diagrams and on requirements' specification.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This document discusses Java input/output (I/O) streams and readers/writers for processing files, URLs, and other sources of input and output. It covers obtaining and working with input and output streams, reading and writing bytes, character encodings, text I/O, random access files, file operations, URL connections, and object serialization. The key classes for I/O include InputStream, OutputStream, Reader, Writer, File, Path, and URLConnection.
The theory of SOLID principles was
introduced by Robert C. Martin in his 2000
paper “Design Principles and Design
Patterns”.
SOLID => Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion.
The document discusses design patterns. It begins with an introduction to design patterns, covering their history and definition. It then covers several fundamental design principles for patterns, including avoiding tight coupling, favoring composition over inheritance, and the single responsibility principle. Finally, it discusses several specific design patterns, including factory method, singleton, strategy, state, and proxy patterns. It provides examples of when and how to apply these patterns.
This document discusses design principles for writing maintainable code, including the SOLID principles. It describes symptoms of bad design like rigidity, fragility, immobility and viscosity. It then explains each SOLID principle in detail: single responsibility principle, open closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle. For each principle, it provides examples of how to apply the principle correctly and the benefits it provides, such as making code easier to change and reuse.
Software engineering - Topics and Research AreasTechsparks
This document provides an overview of key topics in software engineering including the software development life cycle (SDLC), common software development models, software testing, the unified modeling language (UML), software maintenance, and case tools. It also outlines potential thesis, research, and project topics such as data modeling, UML, SDLC methodologies, software quality, and software project management. The document introduces software engineering principles and describes why software engineering practices are required to manage large, complex software projects and products.
This document discusses the design of a document editor called Lexi. It addresses several design problems including document structure, formatting, user interface embellishment, supporting multiple look-and-feel standards and window systems, and user operations like undo/redo. It proposes solutions to these problems using several design patterns like composite, decorator, factory, bridge, command, and iterator patterns to achieve flexibility, extensibility and independence of algorithms and structures. The goal is to create a reusable and extensible design that can be understood and communicated effectively between team members.
This document provides an overview of design patterns including their definition, utility, essential elements, and examples. It discusses creational patterns like singleton, factory, and builder. Structural patterns covered include adapter, proxy, and composite. Behavioral patterns like command and iterator are also introduced. The document is presented as a slideshow by Dr. Lilia Sfaxi on design patterns for software engineering.
The document summarizes a presentation on test automation with Cucumber-JVM. Cucumber allows writing tests in plain text and executing them as automated tests. It supports behavior driven development by writing specifications in a natural language format. Cucumber tests can be written in various programming languages like Java, Ruby, and executed using JUnit. It uses regular expressions and annotations to map steps in feature files to code implementations.
The Single Responsibility Principle (SRP) is one of the 5 SOLID principles. These slides gives you an overview of the principle as well as a refactoring from a non-SRP code to a SRP-code.
Youtube Link: https://youtu.be/DFbhpQpqyuo
** Android Certification Training: https://www.edureka.co/android-development-certification-course **
This Edureka ppt on "Android SDK Tutorial" (Blog Series: http://bit.ly/2MJ6zbc ) will help you understand how Android SDK works.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
Refactoring for Software Design Smells - 1 day Workshop Ganesh Samarthyam
The document discusses various design smells that negatively impact software quality attributes like reusability, changeability, understandability and extensibility. It covers different categories of design smells including abstraction smells, encapsulation smells and modularization smells. Some examples of specific smells discussed are missing abstraction, leaky encapsulation, broken modularization etc. The document emphasizes the importance of addressing design smells through refactoring to improve design quality and reduce technical debt.
This document provides an overview of the SOLID principles of object-oriented design:
- SOLID is an acronym that stands for five design principles introduced by Robert C. Martin. The principles are Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
- Applying these principles helps make software more maintainable, reusable, and understandable by reducing coupling between modules and increasing cohesion within modules. This addresses issues like rigidity, fragility, and immobility that make code difficult to change over time.
- The principles should be applied when refactoring existing code that shows signs of rot, such as code smells, in order to remove these
This document discusses design patterns, beginning with how they were introduced in architecture in the 1950s and became popularized by the "Gang of Four" researchers. It defines what patterns are and provides examples of different types of patterns (creational, structural, behavioral) along with common patterns in each category. The benefits of patterns are that they enable reuse, improve communication, and ease the transition to object-oriented development. Potential drawbacks are that patterns do not directly lead to code reuse and can be overused. Effective use requires applying patterns strategically rather than recasting all code as patterns.
Class object method constructors in javaRaja Sekhar
Presented By :
N.V.Raja Sekhar Reddy
www.technolamp.co.in
www.programming9.com
Want more interesting...
Watch and Like us @ https://www.facebook.com/Technolamp.co.in
subscribe videos @ http://www.youtube.com/user/nvrajasekhar
The document discusses software processes and iterative process models. It describes incremental delivery and spiral development as two iterative process models. Incremental delivery breaks development into increments with each delivering part of the functionality. Spiral development represents the process as a spiral with phases addressing objectives, risks, development and planning. Both models allow for iteration and incorporate user feedback earlier.
A quick-and-dirty introduction to Design Smells, as presented in Robert 'Uncle Bob' Martin book "Agile Software Development". Thought as the first of a series.
Albiorix Technology is sharing the top mobile app development frameworks that you can use for mobile app development. It will help you make the app development process easier for your next app development project.
For More Information: https://www.albiorixtech.com/blog/mobile-app-development-frameworks/
#MobileApp #AppDevelopment #WebAppDevelopment #MobileAppDevelopment #SoftwareDevelopment
Encapsulation is one of the fundamental concepts of object-oriented programming (OOP). It refers to bundling data and methods that operate on that data within a class. This hides the values and state of the data from outside usage. Encapsulation helps bind data and functions together, hides data from direct access, and makes code more flexible and maintainable by allowing changes without affecting other code. The benefits of encapsulation include increased reusability, reduced complexity by hiding implementation details, and extensibility by allowing updates without changing input/output formats.
Code quality is important to ensure code is easy to understand, maintain and extend. Key aspects of code quality include having high test coverage, following design principles like SOLID, and using metrics like maintainability index and technical practices such as pair programming, code reviews, refactoring and test-driven development. Tools like Visual Studio and Resharper can help analyze code quality metrics and identify areas for improvement.
The document provides an introduction to object oriented programming in C# and covers key concepts such as classes, objects, encapsulation, methods, constructors, static members, and partial classes. It includes examples to demonstrate how to define classes, create objects, control access to class members, pass objects to methods, and divide class definitions across multiple files. The overall goal is to help readers understand the basic principles of OOP in C# and how to write and use classes and objects in programs.
Good quality code is an essential property of a software because it could lead to financial losses or waste of time needed for further maintenance, modification or adjustments if code quality is not good enough.
Errori comuni nei documenti di Analisi dei RequisitiRiccardo Cardin
This presentation talks about common errors that I found in my career in documents of specification of requirements. In the presentation are described common errors on use cases, use cases' diagrams and on requirements' specification.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This document discusses Java input/output (I/O) streams and readers/writers for processing files, URLs, and other sources of input and output. It covers obtaining and working with input and output streams, reading and writing bytes, character encodings, text I/O, random access files, file operations, URL connections, and object serialization. The key classes for I/O include InputStream, OutputStream, Reader, Writer, File, Path, and URLConnection.
This presentation introduces some advanced concepts of threads, as implemented in the Java platform. It is part of a series of slides dedicated to threads. This slides introduces the following concepts:
- Callable
- Futures
- Executors and executor services
- Deadlocks (brief introduction)
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
Java Exception Handling, Assertions and LoggingRiccardo Cardin
This presentation introduces the java exception handling mechanisms. In detail, the main focus of the slides is to show how the language implements its exception handling polices, such as:
- Checked and uncheked exception
- Try / catch blocks
- Assertions
- Logging
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the main features of Swing, an UI development library for the Java ecosystem. The main focus of the slides is to show the basic features of Swing, such as:
- Main components (JFrame, JPanel, ...)
- Layout management (FlowLayout, BorderLayout, GridLayout, ...)
- Event handling
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about structural design patterns. In software engineering, structural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities. In particular in the slides are described the following patterns:
- Decorator
- Proxy
- Facade
- Adapter
Design patterns are presented using examples in Java, Scala and Javascript.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the concept of synchronization beatween threads, as implemented in the Java platform. It is the second part of a series of slides dedicated to thread synchronization. This slides introduces the following concepts:
- Conditional locking
- Volatile variables
- Thread confinement
- Immutability
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the concept of synchronization beatween threads, as implemented in the Java platform. It is the first part of a series of slides dedicated to thread synchronization. This slides introduces the following concepts:
- Thread safety
- Types of race conditions
- Locking (reentrant locks, intrinsic locks, synchronized blocks)
- Locking pitfalls
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the main features of Scala, an object oriented and functional programming language. The main focus of the slides is to show how the language implements natively some of the patterns and best practices that are no present in other programming languages, such as Java, C++ and so on.
In detail, the presentation spans these concepts:
- Language's main syntax
- Classes, abstract classes, objects and traits (mixin)
- The Option class
- An introduction to generics
- Implicit classes
- Functions
- Recursion (simple and tail)
- Currying
- Call by value / name
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Design pattern architetturali Model View Controller, MVP e MVVMRiccardo Cardin
This presentation talks about model view controller, model view presenter and model view viewmodel patterns. These are architectural design patterns for implementing user interfaces. They divide a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user. Also, they promote separation of concerns. As examples, some frameworks are reported, such as:
- Spring MVC
- BackboneJS
- AngularJS
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the concept of design pattern in object oriented programming and design. The slides contain information about what a design pattern is, why should we use design pattern and how design patterns could be grouped togheter. The ideas presented in the slides are taken directly from GoF's book "Design Patterns".
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about the main features of UML class diagrams. The slides contain information about how to represent a class, what is a classe feature, what are possible association types, class dependency, hineritance and subtyping.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces some advanced concepts of generics in Java. These slides introduce the following concepts:
- Generic classes and methods
- Type variable bounds
- Type erasure process
- Generics and inheritance
- Wildcard types
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces the Java concept of thread. It is the first part of a series of slides dedicated to concurrent programming. This slides introduces some basics concepts, such as:
- Differences between processes and threads
- Thread's basics
- Thread's states
- Introduction to UML sequence diagrams
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about the main features of UML class diagrams. The slides contain information about how to use sequence diagrams to represent components' interactions in a software system. UML 2.x featuers are also described, like frames.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
Presto was updated from version 0.152 to 0.178. New features in the update include lambda expressions, filtered aggregation, a VALIDATE mode for EXPLAIN, compressed exchange, and complex grouping operations. The update also added new functions and deprecated some legacy features with warnings. Future work on Presto includes disk spill optimization and a cost-based optimizer.
This presentation introduces basic concepts about the Java Remote Method Invocation, a.k.a. RMI. These slides introduce the following concepts:
- Remote interfaces
- Dynamic code loading
- Serialization
- Security manager
- Exporting remote objects
- Compiling and running RMI programs
- Distributed garbage collection
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation is based on Joakim\’s experiences from moving from Java to Scala http://www.scala-lang.org/node/960#Joak We will explore how to move from Java to Scala and why. We\’ll look at things that you will run into sooner rather than later such as Scala\’s collection APIs, Options and higher order functions and special syntax. You will leave this presentation with good foundation to use Scala in practice; perhaps even in your current Java project and ideally with an appetite to learn more.
This presentation talks about some commonly used software architecture patterns. The main features of the following architectural patterns are described:
- Layered architecture
- Event-driven architecture (both mediator and broker topology)
- Microservices architecture (API-REST based, REST based, Centralized message topology)
Each pattern is analyzed in terms of:
- Overall agility
- Ease of deployment
- Testability
- Performance
- Scalability
- Ease of develpment.
The slide refers to the online book "Software Architecture Patterns", Mark Richards, 2015, O’Reilly.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about dependecy injection, an architectural design pattern that aims to help developer to resolve dependencies between objects. Starting by describing general problem of dependecy resolution, the presentation continues presenting Inversion of Control (IoC) pattern, constructor injection and setting injection. As examples, some frameworks and libraries are reported, such as:
- Google Guice
- Spring framework
- AngularJS
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This document discusses object-oriented design principles and patterns. It introduces the SOLID principles: single responsibility, open-closed, Liskov substitution, interface segregation, and dependency inversion. These principles aim to create flexible, reusable, and extensible code. Other principles discussed include composition over inheritance and least knowledge. Common design patterns are inspired by these principles to provide solutions for recurring problems. The document emphasizes that applying object-oriented principles leads to software that can easily adapt to changing requirements.
This document discusses object oriented design principles. It begins with an introduction and agenda. It then covers several object oriented design principles including the open-closed principle, single responsibility principle, interface segregation principle, Liskov substitution principle, and dependency inversion principle. Examples are provided for each. It also discusses bad designs, anti-patterns, and some "evil stuff" to avoid like singletons. The document concludes with a review of key principles like encapsulation, composition over inheritance, programming to interfaces, and loose coupling.
The document discusses the SOLID principles of good object-oriented design: the Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Dependency Inversion Principle, and Interface Segregation Principle. These principles promote design that is flexible, reusable, and maintainable in the face of changing requirements.
The document discusses the SOLID principles of object-oriented design: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Each principle is explained in 1-2 sentences, potential anti-patterns are identified, and examples like jQuery and Rails are given to illustrate how the principles are applied. The overall purpose is to provide guidelines for creating reusable code through these foundational design concepts.
This document discusses the SOLID principles of object-oriented design: Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle. Each principle is explained with examples to illustrate how it promotes high quality code design, reusability, and managing dependencies. The principles encourage writing well-structured, easily maintainable code by focusing on high cohesion, openness for extension and information hiding.
The document discusses the SOLID principles of object-oriented design, which are Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. It defines each principle, provides examples of how to apply it in code, and explains how following the principles can help create code that is loosely coupled, highly cohesive, reusable, and easily testable.
The document discusses the SOLID principles of object-oriented design, which are a set of five design principles intended to make software designs more understandable, flexible and maintainable. It defines each principle: single responsibility, open/closed, Liskov substitution, interface segregation, and dependency inversion. Following these principles helps produce code that is less complex, more readable, extensible, maintainable and reusable with looser coupling between modules and better testability compared to code not following these principles.
The document discusses the SOLID principles of object-oriented design:
1. The Single Responsibility Principle states that a class should have one, and only one, reason to change.
2. The Open/Closed Principle states that software entities should be open for extension but closed for modification.
3. The Liskov Substitution Principle states that child classes must be substitutable for their parent classes.
4. The Interface Segregation Principle states that clients shouldn't depend on interfaces they don't use.
5. The Dependency Inversion Principle states that high-level modules shouldn't depend on low-level modules, and both should depend on abstractions. Concrete
The document discusses the SOLID principles of object-oriented design. It introduces the five SOLID principles: single responsibility principle, open/closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle. Each principle is explained with examples to illustrate how it can make code more maintainable, reusable and less fragile over time. The overall aim of SOLID is to write loosely coupled, highly cohesive code that is easy to reuse and extend without modifying existing code.
The document discusses design principles, patterns, and GRASP patterns. It provides explanations of key principles such as SOLID principles, composite reuse principle, law of demeter, and others. It also explains important design patterns and GRASP patterns. Some key points:
- Design principles like SOLID principles help avoid bad designs and guide developers to create designs that are flexible, understandable, and resilient to change.
- GRASP patterns provide guidelines for assigning responsibilities to classes based on concepts like information expert, creator, and controller.
- Design patterns are proven solutions to common programming problems that can be reused in different situations. Some patterns discussed are creational, structural, and behavioral patterns.
- Applying the right
Becoming a better developer by using the SOLID design principlesKaterina Trajchevska
The document discusses the SOLID design principles for writing maintainable and extensible code. It defines each principle - Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. For each principle, it provides an explanation of what the principle means and how to apply it. It also warns that SOLID principles are guidelines, not rules, and to use common sense over rigidly following the principles. The overall goal of SOLID is to create code that is easy to maintain, extend and understand.
An ultimate guide to SOLID Principles, developers must know.ONE BCG
SOLID Principles represent a set of guidelines that helps us to avoid having a bad design. It is a set of design principles in object-oriented software development.
1. The document discusses principles and best practices for writing clean code as outlined in Chapter 3 of Clean Code by Robert Cecil Martin. It covers topics such as writing small and focused functions, using descriptive names, avoiding flag arguments, and separating commands and queries.
2. Key principles discussed include writing small functions that do one thing well, using block indentation to improve readability, and applying SOLID principles like the single responsibility, open/closed, and dependency inversion principles.
3. The document provides examples of applying these principles, such as extracting logic from functions, replacing switch statements with polymorphism, and avoiding output arguments in functions.
Object Oriented Design Principles
~ How to become a SOLID programmer ~
~ A guide to make a well-designed application with Laravel ~
"Proper Object Oriented Design makes a developer's life easy, whereas bad design makes it a disaster"
This document discusses the SOLID principles of object-oriented design. It introduces each principle - Single Responsibility Principle, Open Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle. For each principle, it provides a brief definition and example to illustrate how to apply that principle to achieve high cohesion and loose coupling in software design. The overall message is that following SOLID principles can help software designs withstand changes over time by avoiding rigidity, fragility, immobility, and viscosity.
This document discusses design principles including the SOLID principles. It describes the Single Responsibility Principle, Open-Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle. For each principle, it provides an example to illustrate how to apply that principle and why it is important for writing high-quality code. It also discusses framework patterns like inversion of control and dependency injection.
The document discusses several software design principles: the single-responsibility principle states that a class should have one responsibility; the open-closed principle states that software should be open for extension but closed for modification; the Liskov substitution principle concerns proper subclassing; the dependency inversion principle concerns high and low-level dependencies; and the interface segregation principle states that clients should not depend on unnecessary interfaces.
SOLID Design Principles for Test AutomaionKnoldus Inc.
The document summarizes the SOLID design principles for test automation. It begins by introducing the five SOLID principles - Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Each principle is then defined individually and examples are provided for how they could be applied to test automation. The benefits of applying each SOLID principle to test automation are discussed, including improved testability, lower coupling, organization, code maintenance, reusability, and overall architectural stability and flexibility.
This document discusses the five SOLID principles of object-oriented design: single responsibility principle, open-closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle. The single responsibility principle states that a class should have one responsibility. The open-closed principle specifies that classes should be open for extension but closed for modification. The Liskov substitution principle indicates that objects should be replaceable with their subtypes without altering program correctness. The interface segregation principle promotes separating general interfaces into specific ones for client needs. Finally, the dependency inversion principle establishes that high-level modules should not depend on low-level ones but instead both should depend on abstractions.
This presentation introduces basic concepts about the Java socket abstraction. These slides introduce the following concepts:
- What is a socket
- How to implement a client program
- How to implement a server program
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation introduces some concepts about the Java Collection framework. These slides introduce the following concepts:
- Collections and iterators
- Linked list and array list
- Hash set and tree set
- Maps
- The collection framework
The presentation is took from the Java course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about behavioural design patterns. In software engineering, behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication. In particular in the slides are described the following patterns:
- Command
- Iterator
- Observer
- Strategy
- Template Method
Design patterns are presented using examples in Java, Scala and Javascript.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about creational design patterns. In software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. In particular in the slides are described the following patterns:
- Singleton
- Builder
- Abstract Factory
Design patterns are presented using examples in Java, Scala and Javascript.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about the main features of UML activity diagrams. The slides contain information about which are the main components of activity diagrams, how to use them to represent business processes and software algorithms.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
This presentation talks about the main features of UML use cases and use cases diagrams. The slides contain information about what is a scenario, an actor, an use case and interactions between them.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
A brief introduction to UML: the history, what are the problems that UML tries to resolve and how we should use it during software design and development.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
A very introductive presentation about how Model-View-Controller pattern (MVC) and Dependence Injection (DI) are implemented in some popular frameworks, such as Spring and Angular JS.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
A very introductive presentation about reactive programming principles. Starting from synchronous standard programming, I try to present the needs that driven to reactive programming. Callbacks, Future, Promises, Observables and Actor model are the main issues. I also make an introduction to the Reactive Manifesto.
The presentation is took from the Software Engineering course I run in the bachelor-level informatics curriculum at the University of Padova.
The Engineering, Procurement, and Construction (EPC) industry is highly complex, involving multiple stakeholders, high-value procurement, strict timelines, and resource-heavy project execution. In such a demanding environment, using the right ERP system is not a luxury—it's a necessity.
This presentation highlights the Top 5 Odoo ERP modules specifically tailored to meet the dynamic needs of the EPC sector. Whether you're managing large-scale infrastructure projects or specialized engineering contracts, Odoo provides an integrated solution that can streamline your entire project lifecycle.
🔍 What’s Inside:
Key challenges faced by EPC companies
Overview of essential Odoo modules
Real-world benefits of using Project, Purchase, Inventory, Field Service, and Accounting modules
How these modules contribute to cost control, real-time visibility, and operational efficiency
This presentation is designed for EPC business owners, project managers, procurement heads, and field service teams who are exploring digital transformation through Odoo ERP.
Scaling up your Snapshot tests, without the frictionarnold844201
We talk about why most companies give up on snapshot tests, and how you can improve your tooling to scale up your snapshot testing (and testing) efforts
Playwright, Cypress, or TestGrid: A Feature-by-Feature Breakdown for Test Aut...Shubham Joshi
Each testing tool has its niche. This in-depth breakdown compares Playwright, Cypress, and TestGrid across key factors like parallel execution, mobile testing capabilities, CI/CD integration, and scripting flexibility. Ideal for teams looking to scale their automation strategy with the right fit.
VALiNTRY360’s Salesforce Experience Cloud Consulting services empower organizations to build personalized, engaging digital experiences for customers, partners, and employees. Our certified Salesforce experts help you design, implement, and optimize Experience Cloud portals tailored to your business goals. From self-service communities to partner collaboration hubs, we ensure seamless integration, enhanced user engagement, and scalable solutions. Whether you're improving customer support or streamlining partner communication, VALiNTRY360 delivers strategic consulting to maximize the value of Salesforce Experience Cloud. Trust us to transform your digital experiences into powerful tools that drive loyalty, efficiency, and growth. Partner with VALiNTRY360 to elevate every user interaction.
For more info visit us https://valintry360.com/salesforce-experience-cloud
Agentic AI Desgin Principles in five slides.pptxMOSIUOA WESI
Discover the core design patterns that enable AI agents to think, learn, and collaborate like never before. From breaking down goals to coordinating across systems, these patterns form the foundation of advanced intelligent behavior. Learn how reinforcement learning, hierarchical planning, and multi-agent systems are transforming AI capabilities. This presentation offers a concise yet powerful overview of agentic design in action. Perfect for developers, researchers, and AI enthusiasts ready to build smarter systems.
Portland Marketo User Group: MOPs & AI - Jeff Canada - May 2025BradBedford3
Jeff Canada is the first MOPs hire at OpenAI, the creator of ChatGPT. He is a team of 1 in a super fast growing company, which is familiar story for many of us. His presentation, originally presented at Mopsapolooza 2024, he gives you an outline of First Steps to Smarter MOPs with the warning label: This is all brand new to everyone; don’t have to jump in head first!
Jeff's story is how he was able to accomplish more via his “AI employees”. Jeff will talk about how he has used OpenAI to help him staff his team with:
AI Researcher
AI Analyst
AI Content Generator
AI Developer
These additional teammates assist with Vendor and Event Selection, Content Generation, Coding Cleanup, and Thinking! His wrap up includes, Guardrails, words of caution, and steps to get you started.
Frontier AI Regulation: What form should it take?Petar Radanliev
Frontier AI systems, including large-scale machine learning models and autonomous decision-making technologies, are deployed across critical sectors such as finance, healthcare, and national security. These present new cyber-risks, including adversarial exploitation, data integrity threats, and legal ambiguities in accountability. The absence of a unified regulatory framework has led to inconsistencies in oversight, creating vulnerabilities that can be exploited at scale. By integrating perspectives from cybersecurity, legal studies, and computational risk assessment, this research evaluates regulatory strategies for addressing AI-specific threats, such as model inversion attacks, data poisoning, and adversarial manipulations that undermine system reliability. The methodology involves a comparative analysis of domestic and international AI policies, assessing their effectiveness in managing emerging threats. Additionally, the study explores the role of cryptographic techniques, such as homomorphic encryption and zero-knowledge proofs, in enhancing compliance, protecting sensitive data, and ensuring algorithmic accountability. Findings indicate that current regulatory efforts are fragmented and reactive, lacking the necessary provisions to address the evolving risks associated with frontier AI. The study advocates for a structured regulatory framework that integrates security-first governance models, proactive compliance mechanisms, and coordinated global oversight to mitigate AI-driven threats. The investigation considers that we do not live in a world where most countries seem to be wishing to follow our ideals, for various reasons (competitiveness, geo-political dominations, hybrid warfare, loss of attractiveness of the European model in the Big South, etc.), and in the wake of this particular trend, this research presents a regulatory blueprint that balances technological advancement with decentralised security enforcement (i.e., blockchain).
We’re honored to share the official keynote presentation that opened CFCamp 2025, led by Luis Majano, creator of ColdBox, BoxLang, and CEO of Ortus Solutions.
This PDF features the full slide deck from Day 1’s keynote, where Luis presented a powerful vision for the future of modern CFML development, highlighted the evolution of BoxLang, and shared how Ortus is helping shape a dynamic future for developers around the world.
A heartfelt thank you to the CFCamp team for the opportunity to lead the keynote and showcase the innovation, community, and open source spirit driving the next chapter of CFML. 🚀
Shortcomings of EHS Software – And How to Overcome ThemTECH EHS Solution
Shortcomings of EHS Software—and What Overcomes Them
What you'll learn in just 8 slides:
- 🔍 Why most EHS software implementations struggle initially
- 🚧 3 common pitfalls: adoption, workflow disruption, and delayed ROI
- 🛠️ Practical solutions that deliver long-term value
- 🔐 Key features: centralization, security, affordability
- 📈 Why the pros outweigh the cons
Perfect for HSE heads, plant managers, and compliance leads!
#EHS #TECHEHS #WorkplaceSafety #EHSCompliance #EHSManagement #ehssoftware #safetysoftware
A tailored CRM that helps insurance agents streamline interactions, enhance engagement, and drive growth through automation and centralized data. Visit https://www.damcogroup.com/insurance/crm-software for more details!
2. Ingegneria del software mod. B
SUMMARY
Introduction
Single Responsibility Principle
Open Closed Principle
Liskov Substitution Principle
Interface Segregation Principle
Dependency Inversion Principle
2Riccardo Cardin
3. Ingegneria del software mod. B
INTRODUCTION
Structured programming and Object-oriented
programming
Two of the most important revolution of IT industry
Everyone uses OO languages, but...
Today's programmers are unaware of the principles
that are the foundation of Object Orientation
Dependency management
The art of making code flexible, robust, and reusable
It’s too easy to get a bunch of tangled legacy code
SOLID principles
A set of class design principles that helps to manage
dependency
3Riccardo Cardin
4. Ingegneria del software mod. B
INTRODUCTION
SOLID principles
Single Responsibility Principle
A class should have one, and only one, reason to change
Open Closed Principle
You should be able to extend a classes behavior, without
modifying it
Liskov Substitution Principle
Derived classes must be substitutable for their base classes
Interface Segregation Principle
Make fine grained interfaces that are client specific
Dependency Inversion Principle
Depend on abstractions, not on concretions
4Riccardo Cardin
5. Ingegneria del software mod. B
SINGLE RESPONSIBILITY PRINCIPLE
Also known as cohesion
Functional relatedness of the elements of a module
A module should have only one reason to change
We call this reason of change responsibility
Coupled responsibilities
Changes to one responsibility may impair or inhibit
the class’ ability to meet the others
Fragile design that break in unexpected ways
Recompilation, test, deploy, …
5Riccardo Cardin
6. Ingegneria del software mod. B
SINGLE RESPONSIBILITY PRINCIPLE
6Riccardo Cardin
Uses Rectangle to help it with the
mathematics of geometric shapes. It
never draws the rectangle on the
screen
It definitely draws the rectangle
on the screen.
The Rectangle class has two
responsibilities.
• Provides a mathematical
model
• Renders the rectangle on
a GUI
7. Ingegneria del software mod. B
SINGLE RESPONSIBILITY PRINCIPLE
7Riccardo Cardin
Responsibilities are separeted
into two completely different
classes
Renders the rectangle on a
GUI
Provides a mathematical
model
8. Ingegneria del software mod. B
SINGLE RESPONSIBILITY PRINCIPLE
What is really a responsibility?
An axis of change is only an axis of change if the
changes actually occur
The context of the application is also important
Needless complexity
Should these two responsibilities be separated?
That depends upon how the application is changing.
8Riccardo Cardin
public interface Modem {
public void dial(String pno);
public void hangup();
public void send(char c);
public char recv();
}
Connection management
Data communication
9. Ingegneria del software mod. B
SINGLE RESPONSIBILITY PRINCIPLE
Eventually separate responsibilities avoids rigidity
They are still coupled in ModemImplementation, but clients
don’t need to worry about interface implementations
9Riccardo Cardin
11. Ingegneria del software mod. B
OPEN-CLOSE PRINCIPLE
There are many heuristics in OOD
Software entities should be open for extension, but
closed for modification
You extend behaviour adding new code, not changing the old
The Open-Close Principle underlines these heuristics
Abstraction is the key
Abstract types are the fixed part, derivate classes
points of extension
11Riccardo Cardin
“All member variables should be private”, “Global variables
should be avoided”, “Using run time type identification (RTTI) is
dangerous”
12. Ingegneria del software mod. B
OPEN-CLOSE PRINCIPLE
12Riccardo Cardin
Client class
must be changed to
name the new
server class.
If we want Client
objects to use a
different server
class, then a new
derivative of the
AbstractServer
class can be
created.
The Client class
can remain
unchanged.
O
C
P
13. Ingegneria del software mod. B
OPEN-CLOSE PRINCIPLE
13Riccardo Cardin
public static void drawAll(Shape[] shapes) {
for (Shape shape : shapes) {
switch (shape.shapeType) {
case Square:
((Square) shape).drawSquare();
break;
case Circle:
((Circle) shape).drawCircle();
break;
}
}
}
Does not conform to the open-
closed principle because it
cannot be closed against new
kinds of shapes. If I wanted to
extend this function, I would
have to modify the function
14. Ingegneria del software mod. B
OPEN-CLOSE PRINCIPLE
Programs conforming to OCP do not experience
«cascade of changes»
Changes are obtained adding new code
14Riccardo Cardin
public static void drawAll(Shape[] shapes) {
for (Shape shape : shapes) {
shape.draw();
}
}
Solution that conforms to open-
close principle. To extend the
behavior of the drawAll to draw
a new kind of shape, all we need
do is add a new derivative of the
Shape class.
15. Ingegneria del software mod. B
OPEN-CLOSE PRINCIPLE
No program can be 100% closed
Closure must be strategic
Closure can be gained through abstraction
Using interfaces and polimorphim
The draw abstract method in the Shape class
...or can be gained in a «data-driven» fashion
Sometimes using information configured in external
structure can be the only solution
What if we want to draw shapes in a specific order that
depends from type!?
15Riccardo Cardin
17. Ingegneria del software mod. B
OPEN-CLOSE PRINCIPLE
Conventions and heuristics derived from OCP
Make all member variables private
When the member variables of a class change, every function
that depends upon them must be changed
Encapsulation
No global variables (ever)
No module that depends upon a global variable can be closed
against any other module that might write to that variable
There are very few cases that can disobey (i.e. cin, cout)
RTTI is dangerous
The Shape example shows the bad way to use RTTI
But there are also good cases…
17Riccardo Cardin
18. Ingegneria del software mod. B
LISKOV SUBSTITUTION PRINCIPLE
Abstraction and polymorphism
At the basis of OOD and OCP
What are the characteristics of the best inheritance
hierarchies? What are the traps?
Liskov Substitution Principle
It a special case of the real LSP ;)
Violating this principle means violating OCP
Function that uses a pointer or reference to a base class, but
must know about all the derivatives of that base class.
18Riccardo Cardin
Functions that use pointers or references to base classes must
be able to use objects of derived classes without knowing it.
19. Ingegneria del software mod. B
LISKOV SUBSTITUTION PRINCIPLE
19Riccardo Cardin
A Square does not need both
height and width member
variables. Yet it will inherit them
anyway. Clearly this is wasteful.
Square will inherit the setWidth
and setHeight functions. These
functions are utterly inappropriate
for a Square.
But, we could override them...
public void setWidth(double width) {
super.setWidth(width);
super.setHeight(width);
}
public void setHeight(double height) {
this.setWidth(height);
}
20. Ingegneria del software mod. B
LISKOV SUBSTITUTION PRINCIPLE
A model, viewed in isolation, can not be
meaningfully validated
The validity of a model can only be expressed in
terms of its clients
20Riccardo Cardin
public void f(Rectangle r) {
r.setWidth(32);
}
@Test
public void testF() {
Rectangle r = new Square();
r.setHeight(15);
f(r);
// This test will not pass!!!
assertEquals(32, r.getWidth);
}
If we pass a reference to a
Square object into this
function, and the height will
be changed too.
This is a clear violation of
LSP. The f function does not
work for derivatives of its
arguments.
22. Ingegneria del software mod. B
LISKOV SUBSTITUTION PRINCIPLE
What went wrong?
What counts is extrinsic public behavior
Behavior that clients depend upon
The relation between Square and Rectangle is not a IS-A
relation in OOD
Design by contract
Methods of classes declare preconditions and
postconditions (invariants)
22Riccardo Cardin
...when redefining a routine [in a derivative], you may only replace its
precondition by a weaker one, and its postcondition by a stronger one.
// Rectangle.setWidth(double w) postconditions
assert((width == w) && (height == old.height));
23. Ingegneria del software mod. B
LISKOV SUBSTITUTION PRINCIPLE
Design by contract
In a derivate class preconditions must not be stronger
than in the base class
Using base class interface a client knows only base class
preconditions
In a derivate class postconditions must be stronger
than in the base class
Derived class must conform to all base class prostcondition.
The behaviors and outputs must not violate any of the
constraints established for the base class
Java and JVM base languages have assert primitive.
C++ does not have anything such this
23Riccardo Cardin
24. Ingegneria del software mod. B
INTERFACE SEGREGATION PRINCIPLE
Reducing coupling means to depend upon
interfaces, not implementations
The risk is to depend upon a «fat» or «polluted»
interfaces
Fat interfaces are not cohesive
Methods can be broken up into groups of functions
Clients must view only the part they are interested to
Interface Segregation Principle
24Riccardo Cardin
Clients should not be forced to depend upon interfaces that they do not
use
25. Ingegneria del software mod. B
INTERFACE SEGREGATION PRINCIPLE
25Riccardo Cardin
In this system there are Door objects that can
be locked and unlocked, and which know
whether they are open or closed.
Clients used this interface to managed doors.
Now consider that one such
implementation. TimedDoor
needs to sound an alarm when
the door has been left open for too long.
In order to do this the TimedDoor object
communicates with another object called a Timer.
TimeClient method represents the function called
when the timeout expires
26. Ingegneria del software mod. B
INTERFACE SEGREGATION PRINCIPLE
First solution
26Riccardo Cardin
The Door class now depends upon
TimerClient. Not all varieties of Door need
timing. Moreover, the applications that use those
derivatives will have to import the definition of
the TimerClient class, even though it is not
used.
The interface of Door has been polluted with an
interface that it does not require. Each time a
new interface is added to the base class, that
interface must be implemented in derived
classes.
Default implementations violate the
Liskov Substitution Principle (LSP)
28. Ingegneria del software mod. B
INTERFACE SEGREGATION PRINCIPLE
Clients of Door and TimerClient are different
The interfaces should remain separate too
Sometimes it is the client that forces a change to an
interface
Also the Door interface have to be changed
Clients that does not need timer doors will also be affected
The result is a inadvertent coupling between all the
clients
28Riccardo Cardin
public class Timer {
void register(int timeout, int timeOutId, TimerClient client);
}
public interface TimerClient {
// A change to Timer implies a change to TimerClient
void timeOut(int timeOudId);
}
29. Ingegneria del software mod. B
INTERFACE SEGREGATION PRINCIPLE
Separation by delegation
Object form of the Adapter design pattern
DoorTimerAdapter translates a Door into a TimerClient
Clients of Door and TimerClient are not coupled
anymore
29Riccardo Cardin
30. Ingegneria del software mod. B
INTERFACE SEGREGATION PRINCIPLE
Separation through multiple inheritance
Class form of the Adapter design pattern
Client can use the same object through different and
separate interfaces
Possible only when multiple inheritance is supported
Less types used wrt the solution that uses delegation
30Riccardo Cardin
31. Ingegneria del software mod. B
DEPENDENCY INVERSION PRINCIPLE
Bad design often derives from degradation due to
new requirement and maintanance
Rigidity – hard to change because every change affects
to many part of the system
Fragility – when you make a change, unexpected parts
of the system break
Immobility – It is hard to reuse in another application
because it cannot be easily disentangled
TNTWIWHDI – That’s not the way I would have done it
Interdependence of the modules
31Riccardo Cardin
32. Ingegneria del software mod. B
DEPENDENCY INVERSION PRINCIPLE
32Riccardo Cardin
Consider a simple program that
is charged with the task of
copying characters typed on a
keyboard to a printer.
“Read keyboard” and “Write
printer” are quite reusable.
However the “Copy” module is
not reusable in any context that
does not involve keyboard and
printer
public void copy(OutputDevice dev) {
int c;
while ((c = readKeyboard()) != EOF)
if (dev == PRINTER)
writePrinter(c);
else
writeDisk(c);
}
Violates
OCP
33. Ingegneria del software mod. B
DEPENDENCY INVERSION PRINCIPLE
Module containing high level policy should be
independent upon low level details modules
We have use abstraction to limit dependency
33Riccardo Cardin
We have performed dependency
inversion. the dependencies
have been inverted; the “Copy”
class depends upon abstractions,
and the detailed readers and
writers depend upon the same
abstractions.
Now we can reuse the “Copy”
class, independently of the
“Keyboard Reader” and the
“Printer Writer”.
34. Ingegneria del software mod. B
DEPENDENCY INVERSION PRINCIPLE
Dependency Inversion Principle
Important policy decisions are in high level modules
It’s these modules we want to be able to reuse
Template method design pattern
In layered application, each layer should expose a
proper level of abstraction (interface)
A naive implementation can force wrong dependency among
modules
34Riccardo Cardin
High level modules should not depend upon low level modules. Both
should depend upon abstractions.
Abstractions should not depend upon details. Details should depend
upon abstractions.
35. Ingegneria del software mod. B
DEPENDENCY INVERSION PRINCIPLE
35Riccardo Cardin
The high level policy class uses a
lower level Mechanism; which in
turn uses a detailed level utility
class. The Policy Layer is sensitive
to changes all the way down in the
Utility Layer.
Each of the lower level layers are
represented by an abstract class.
Each of the higher level classes
uses the next lowest layer through
the abstract interface. Thus, none
of the layers depends upon any of
the other layers.
37. Ingegneria del software mod. B
REFERENCES
The Principles of OOD
http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
Chap. 8 “The Single-Responsibility Principle (SRP)”, Agile Principles,
Patterns, and Practices in C#, Robert C. Martin, 2006, Prentice Hall
Chap. 9 “The Open/Closed Principle (OCP)”, Agile Principles,
Patterns, and Practices in C#, Robert C. Martin, 2006, Prentice Hall
Chap. 10 “The Liskov Substitution Principle (LSP)”, Agile Principles,
Patterns, and Practices in C#, Robert C. Martin, 2006, Prentice Hall
Chap. 11 “The Dependency-Inversion Principle (DIP)”, Agile
Principles, Patterns, and Practices in C#, Robert C. Martin, 2006,
Prentice Hall
Chap. 12 “The Interface Segregation Principle (ISP)”, Agile
Principles, Patterns, and Practices in C#, Robert C. Martin, 2006,
Prentice Hall
37Riccardo Cardin