100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary design patterns - Objectgerichte systemen

Rating
-
Sold
-
Pages
7
Uploaded on
19-08-2024
Written in
2023/2024

Complete summary of all the design patterns

Institution
Module









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Module

Document information

Uploaded on
August 19, 2024
Number of pages
7
Written in
2023/2024
Type
Summary

Subjects

Content preview

Design Patterns


Loose coupling
A general principle to make (software) systems easier to maintain by heavily relying on all kinds of indirections.

A should not refer to B but rely on some mechanism that will associate it with B. It should be easy to substitute B for Bʼ.
a loosely coupled system is one

 in which components are weakly associated with each other, and thus changes in one component least affect existence or
performance of another component

 in which each of its components has, or makes use of little or no knowledge of the definitions of other separate components.

Tight vs loose coupling




Heuristic 1: Law of demeter
A method m sitting in some object o may only send messages to the following objects:

this (+ itʼs vals and vars)

mʼs parameters

local variables

objects created in m

variables in the scope of m

>
- Make class structures easier to replace without having to change existing code.




An method should not send messages to objects returned by other methods or to objects acquired by accessing sequences of
public instance variables.
In Scala that boils down to “use only one dotˮ in expressions such as “o.m().n().p()ˮ or “o.m.n.p()ˮ


You should only rely on the interface of an object, not on its constituents




Design Patterns 1

, Heuristic 2: SOLID principles
make designs easier to change without having to change existing code.
Single responsibility principle: a class should have one and only one reason to change

Same as ADT-design

Open-closed principle: the ability to extend the behaviour of a class, without modifying it

Design Patterns

Liskov substitution principle: derived classes must be substitutable for their base classes

Design Hierarchies

Interface segregation principle: make fine-grained interfaces that are client-specific

Use Traits

Dependency inversion principle: depend on abstractions, not on concrete implementations

Build software frameworks, not just programs. Use the Hollywood principle.

don't coll us , we be call
you




GOF




Strategy pattern
Definieer een “familieˮ van gelijksoortige algoritmen, encapsuleer deze in een hiërarchie van strategieën, en maak de algoritmen
dynamisch uitwisselbaar. Het werk wordt gedelegeerd naar de strategie.
losed principle
·
,
open


main object - behaviour
·




Design Patterns 2
£2.71
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
robinbouchez

Get to know the seller

Seller avatar
robinbouchez Vrije Universiteit Brussel
Follow You need to be logged in order to follow users or courses
Sold
1
Member since
2 year
Number of followers
1
Documents
10
Last sold
1 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions