Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University

Slides:



Advertisements
Similar presentations
Software Quality Assurance QA Engineering, Testing, Bug Tracking, Test Automation Software University Technical Trainers SoftUni Team.
Advertisements

 Dimitar Ivanov Introduction to programming with microcontrollers.
C# Advanced Topics Methods, Classes and Objects SoftUni Team Technical Trainers Software University
AngularJS Routing Routes, Route Parameters, Templates, Location, Navigation SoftUni Team Technical Trainers Software University
AngularJS Services Built-in and Custom Services SoftUni Team Technical Trainers Software University
Methods Writing and using methods, overloads, ref, out SoftUni Team Technical Trainers Software University
Software University Curriculum, Courses, Exams, Jobs SoftUni Team Technical Trainers Software University
Fundamentals SoftUni Welcome to Software University SoftUni Team Technical Trainers Software University
Design Patterns: Introduction. Creational Design Patterns General and reusable solutions to common problems in software design Software University
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC SoftUni Team Technical Trainers Software University
AngularJS Directives Defining Custom Directives SoftUni Team Technical Trainers Software University
Software Testing Lifecycle Exit Criteria Evaluation, Continuous Integration Ivan Yonkov Technical Trainer Software University.
Teamwork and Personal Skills Course Introduction Software University SoftUni Team Technical Trainers.
Fundamentals SoftUni Welcome to Software University SoftUni Team Technical Trainers Software University
Design Patterns: Structural Design Patterns
JavaScript Design Patterns Private Fields, Module, Revealing Module, Revealing Prototype, … Software University Technical Trainers SoftUni.
NoSQL Databases NoSQL Concepts SoftUni Team Technical Trainers Software University
Conditional Statements Implementing Control-Flow Logic in C# SoftUni Team Technical Trainers Software University
Consuming REST Services from C# SoftUni Team Technical Trainers Software University
Loops Repeating Code Multiple Times SoftUni Team Technical Trainers Software University
Start Your Own Blog Angel Georgiev Part-time Trainer angeru.softuni-friends.org Software University The Culture of Knowledge Sharing.
Database APIs and Wrappers
Svetlin Nakov Technical Trainer Software University
Build Processes and Continuous Integration Automating Build Processes Software University Technical Trainers SoftUni Team.
Processing Redis with.NET How to Operate with Redis Databases SoftUni Team Technical Trainers Software University
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC Angel Georgiev Part-time Trainer Software University
Test-Driven Development Learn the "Test First" Approach to Coding SoftUni Team Technical Trainers Software University
AMD and RequireJS Splitting JavaScript Code into Dependent Modules Software University Technical Trainers SoftUni Team.
Asynchronous Web Services Writing Asynchronous Web Services SoftUni Team Technical Trainers Software University
Jekyll Static Site Generator Template-Based Site Generation Svetlin Nakov Technical Trainer Software University
Forms Overview, Query string, Submitting arrays, PHP & HTML, Input types, Redirecting the user Mario Peshev Technical Trainer Software.
JavaScript Modules and Patterns Private Fields, Module, Revealing Module, Revealing Prototype, … Software University Technical Trainers.
Responsive Design Design that Adapts to Different Devices SoftUni Team Technical Trainers Software University
Exam Preparation Algorithms Course: Sample Exam SoftUni Team Technical Trainers Software University
Mind Mapping Visually Outline Ideas, Take Notes Efficiently, Summarize Information, Improve Memorization SoftUni Team Technical Trainers Software University.
Tables, Rows, Columns, Cells, Header, Footer, Colspan, Rowspan
High-Quality Code: Course Introduction Course Introduction SoftUni Team Technical Trainers Software University
Design Patterns II Structural, Behavioral and Others SoftUni Team Software University
Advanced C# Course Introduction SoftUni Team Technical Trainers Software University
Object-Oriented Programming Course Introduction Svetlin Nakov Technical Trainer Software University
Reflection Programming under the hood SoftUni Team Technical Trainers Software University
Mocking with Moq Tools for Easier Unit Testing SoftUni Team Technical Trainers Software University
Design Patterns: Behavioral Design Patterns General and reusable solutions to common problems in software design Software University
Data Structures Curriculum, Trainers, Evaluation, Exams SoftUni Team Technical Trainers Software University
Mocking Unit Testing Methods with External Dependencies SoftUni Team Technical Trainers Software University
Mocking with Moq Mocking tools for easier unit testing Svetlin Nakov Technical Trainer Software University
JavaScript Tools Tools for Writing / Editing / Debugging JavaScript Code Svetlin Nakov Technical Trainer Software University
ORM Basics Repository Pattern, Models, Entity Manager Ivan Yonkov Technical Trainer Software University
Test-Driven Development Learn the "Test First" Approach to Coding Svetlin Nakov Technical Trainer Software University
Programming for Beginners Course Introduction SoftUni Team Technical Trainers Software University
Sets, Dictionaries SoftUni Team Technical Trainers Software University
Creating Content Defining Topic, Creating Technical Training Materials SoftUni Team Technical Trainers Software University
High-Quality Code: Course Introduction Course Introduction SoftUni Team Technical Trainers Software University
Advanced Tree Structures Binary Trees, AVL Tree, Red-Black Tree, B-Trees, Heaps SoftUni Team Technical Trainers Software University
Functional Programming Data Aggregation and Nested Queries Ivan Yonkov Technical Trainer Software University
Programming Fundamentals Course Introduction SoftUni Team Technical Trainers Software University
Doctrine The PHP ORM SoftUni Team Technical Trainers Software University
Creating Content Defining Topic, Creating Technical Training Materials SoftUni Team Technical Trainers Software University
ASP.NET MVC Course Program, Trainers, Evaluation, Exams, Resources SoftUni Team Technical Trainers Software University
Inheritance Class Hierarchies SoftUni Team Technical Trainers Software University
Stacks and Queues Processing Sequences of Elements SoftUni Team Technical Trainers Software University
Generics SoftUni Team Technical Trainers Software University
C# OOP Advanced Course Introduction SoftUni Team Technical Trainers Software University
Java OOP Advanced Course Introduction SoftUni Team Technical Trainers Software University
High-Quality Programming Code Code Correctness, Readability, Maintainability, Testability, Etc. SoftUni Team Technical Trainers Software University
Interface Segregation / Dependency Inversion
Introduction to MVC SoftUni Team Introduction to MVC
Describe ways to assemble objects to implement a new functionality
Entity Framework: Relations
Object Oriented Design Patterns - Structural Patterns
Presentation transcript:

Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University Technical Trainers SoftUni Team

Table of Contents  Structural Design Patterns:  Façade, Composite, Proxy, Decorator, Adapter, Bridge, Flyweight  Other Design Patterns 2

Structural Patterns

4  Describe ways to assemble objects to implement a new functionality  Make design easier by identifying a simple way to construct relationships between entities  These design patterns are about class and object composition  Structural class creation patterns use inheritance to compose interfaces  Structural object patterns define ways to compose objects to obtain new functionality Structural Patterns

5  Used too deliver convenient interface from higher level to a group of subsystems or single complex subsystem  Used in many Win32 API based classes to hide Win32 complexity  Façade Pattern

6  Composite Pattern allows to combine different types of objects in tree structures  Gives the possibility to treat the same individual objects or groups of objects  Used when  You have different objects and you want to treat them the same way  You want to present a hierarchy of objects  Composite Pattern

7  An object representing another object  Provide a surrogate or placeholder for another object to control access to it  Use an extra level of indirection to support distributed, controlled, or intelligent access  Add a wrapper and delegation to protect the real component from undue complexity  Example: Web Service  The Proxy Pattern

8  Allows adding responsibilities to objects dynamically  Wrapping original component  Alternative to inheritance (prevents class explosion problem)  Support Open-Closed principle  In.NET: CryptoStream decorates Stream  Decorator Pattern

9  Converts a class interface into another class requested by the client  Wrap an existing class with a new interface  Impedance match an old component to a new system  Allows classes to work together when this is impossible due to incompatible interfaces  Adapter Pattern

10  Used to divide the abstraction and its implementation (they are coupled by default)  That way both can be rewritten independently  Solves problems usually solved by inheritance  From: Abstraction -> Implementation To: Abstraction -> Abstraction -> Implementation  Bridge Pattern

11  Proxy – to lazy-instantiate an object, or hide the fact that you're calling a remote service, or control access to the object (one-to-one interface)  Decorator – to add functionality to an object runtime (not by extending that object's type)  Adapter – to map an abstract interface to another object which has similar functional role, but a different interface (changes interface for the client)  Bridge – to define both the abstract interface and the underlying implementation. You're not adapting to some legacy or third-party code, you're the designer of all the code but you need to be able to swap out different implementations (all changeable) Proxy vs. Decorator vs. Adapter vs. Bridge

12  Use sharing to support large numbers of fine-grained objects efficiently  Reduce storage costs for large number of objects  Share objects to be used in multiple contexts simultaneously  Retain object oriented granularity and flexibility  Flyweight Pattern

13  Structural Design Patterns:  Façade, Composite, Proxy, Decorator, Adapter, Bridge, Flyweight  Other Design Patterns Summary

? ? ? ? ? ? ? ? ? Structural Design Patterns

License  This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" licenseCreative Commons Attribution- NonCommercial-ShareAlike 4.0 International 15  Attribution: this work may contain portions from  "Fundamentals of Computer Programming with C#" book by Svetlin Nakov & Co. under CC-BY-SA licenseFundamentals of Computer Programming with C#CC-BY-SA  "High Quality Code" course by Telerik Academy under CC-BY-NC-SA licenseHigh Quality CodeCC-BY-NC-SA

Free Software University  Software University Foundation – softuni.orgsoftuni.org  Software University – High-Quality Education, Profession and Job for Software Developers  softuni.bg softuni.bg  Software Facebook  facebook.com/SoftwareUniversity facebook.com/SoftwareUniversity  Software YouTube  youtube.com/SoftwareUniversity youtube.com/SoftwareUniversity  Software University Forums – forum.softuni.bgforum.softuni.bg