Patterns
Why? 🤔
Why do we care about patterns and why do we want to study them?
Universe
In the space and time there is matter and energy.
Universe: Diagram of the universe objects and classes
Senses
Inside that Universe there are living beings that have the ability to perceive external and internal physical stimulations through certain organs which are passed to our nervous system:
- Sight
- Hearing
- Smell
- Taste
- Touch
Physical signals that can vary in their frequency, width, ... and transform in different color values decomposed into combinations of red, green and blue or different values of words decomposed into phonemes, a, ae, e, i, o , u, ... depending on the language.
Light spectrum
Measurement units
Basic units
Physics | Other areas |
---|---|
International Unit System | Economic system, Educational System... |
Time: second | Music: pulse |
Length: meter | Education: subject |
Mass: kilogram | Money euro, dollar |
Derived units
Physics | Other areas |
---|---|
International Unit System | Economic system, Educational System... |
Force: newton (mass*length/time2) | Music: compass |
... | Maths: complex number, vector... |
Names
Physics | Other areas |
---|---|
International Unit System | Economic system, Educational System... |
Multiples: kilometer | Music: salsa, trap... |
Time: year, month, week | Education: graduated |
Distance: light year | Computer science: kilobyte, petabyte... |
Relations
Value | Roman | Decimal | Binary |
---|---|---|---|
0 | Non existent | 0 | 0 |
next(0) | I | 1 | 1 |
next( next(0)) | II | 2 | 10 |
... | ... | ... | ... |
next( next( next(0)))... | XII | 12 | 1100 |
... | ... | ... | ... |
What? 🤓
What is a pattern?
Pattern, model that is used to get an equal thing
Pattern for an artisan and in industry:
Pattern in science:
Equality
Body/Entity | Identity |
---|---|
What it is, exists or can exist | Set of characteristics that differentiates something or someone from others |
What makes something's essence be | Conscience that someone or a group have and that makes them be their own and not other |
Equal | Context |
---|---|
That has the same characteristics of another person or thing in some or all aspects | Precision: necessary to provide the grade of precision when comparing equality |
Of the same class or condition | Identifier: people's names or nicknames, concepts, my first child... |
Of the same value or preciousness |
For what? 😲
For what do we need patterns?
To be able to, from the present, study the past and predict/imagine the future.
How? 🧐
How are patterns? How do we find them in our universe?
Pattern types
Recurrent
It will eventually repeat. Example of recurrent pattern would be the rain. You don't know when but it will eventually rain at some point.
Iterative
It repeats, the end of one iteration directly connects with the beginning of a new one. Example of an iterative pattern would be day and night.
Recursive
It repeats in itself. You can amplify or reduce its point of view and it will replicate the same structure.
Recursion everywhere
We can find examples of recursion in nature
Caracola
Brocoli
In our daily life
Family tree
In art
Katsushika Hokusai
Simple Patterns
Line | Three points | Circle |
---|---|---|
![]() | ||
Sequence | Alternation | Circularity |
Line of time | Water molecule, mountains | Cells, soap bubbles |
Metro line | Pyramids | Hurricanes |
natural or artificial frontier, line of products... | Social organizations, economy... | Roundabouts, vicious and virtuous circles |
Patterns in software 🖥
Graphical User Interface
Line | Three points | Circle |
---|---|---|
Form | Window with panels | Navigation map |
![]() | ![]() | ![]() |
Data types
Line | Three points | Circle |
---|---|---|
Class, structure, registry, entity... | Inheritance, composition, union, aggregation... | Circular dependencies, circular relations... |
Data structures
Line | Three points | Circle |
---|---|---|
List | Tree, Hierarchy | Graph |
![]() | ![]() | ![]() |
Flow control sentences
Line | Three points | Circle |
---|---|---|
Sequential sentence | Alternant sentence | Iterative sentence |
{ | if (x > 0) { | while (x > 0) { |
Development methodologies
Line | Three points | Circle |
---|---|---|
Waterfall | Crystal Clear | Iteratives |
![]() | ![]() | ![]() |
Domain model 👌🏼
The domain model describes the most important concepts (types of objects) of a context, things like objects from the domain and the relations between them.
- Business objects that represent things that are manipulated by the business.
- Real world objects and concepts which a system has to keep track of.
- Events that will or have already occur.
With the objective of
- Comprehend the structure and dynamics of the organization in which the system will be developed.
- Comprehend the latest problems of the target organization.
- Ensure that clients, final users and developers have a common comprehension of the target organization.
- Obtain the requirements of the system to help the target organization.
DANGER
Never talk about the system's software! Don't mention words like view, validator, etc.
Unified Model Language
The usage of UML (Unified Model Language) is recommended to model the domain. RUP (Rational Unified Process) already does so.
Each symbol (lexical) related (syntax) in a diagram has a standard meaning (semantics). We avoid ambiguity and different people interpret the same from the same diagram, opposed to non standardized arrows and boxes.
Structural diagrams
Objects diagram | Classes diagram |
---|---|
Picture (static) of entities from reality | Picture (static) of classes of entities from reality |
![]() | ![]() |
Barely used | Extremely used |
Behavioral diagrams
Activity diagram | State diagram |
---|---|
Video (dynamic) with sequence of highlighted actions | Video (dynamic) with sequence of NOT highlighted actions, highlighting in-between states |
![]() | ![]() |
Barely used | Extremely used |
Sequence diagram | Collaboration diagram |
---|---|
Video (dynamic) with sequence of actions between different collaborators | Picture (static) without sequence of actions between different collaborators |
![]() | ![]() |
Barely used | Extremely used |
Domain Model conclusions
- Comprehend the context of a system with crucial knowledge about use cases.
- Define a common vocabulary for users, clients, developers and others involved.
- Glossary of keywords.
- Consistent mix of all participants' language.
- Suggest internal classes during analysis.