Advanced
slides.com/veeenex/pb007
Student of Master’s degree programme Software Systems Development Management. In the spring semester, I am a seminar tutor of PV260 Software Quality.
Student of Bachelor’s degree programme Bioinformatics. Seminartutor of PV281, PB138 and PB007. Currently freelance DevOps, Project Manager, Consultant
No, we’re not a couple.
Average client
* Main reason to create Discord server is for doxxing students, we do not take any responsibility for joining server
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
reDiscover for Turists in random groups on coggle
The pandemic forced the owners to close their shops and stores and thus loosing their income. The gastronomic and tourist industries suffered the greatest impact. The municipalities of several cities have decided to change the situation with a vision to create a game that would help bring life back on track and support tourism by helping small and medium-sized businesses in cities and regions.
The aim of the reDiscover project is to create an affordable application that would reward users for supporting tourism and at the same time would attract tourists to lesser-known places and thus support the economic growth of regions and places. Within the application, users collects points and badges to redeem awards, which can later be used in businesses, events and for various attractions.
#attendLectures
author: Daminán Paranič
@startuml
skinparam packageStyle rect
' Define actors
actor "Teacher" as teacher
actor "Student" as student
actor "Internal Teacher" as internal_teacher
actor "External Teacher" as external_teacher
' Define system boundaries and usecases
rectangle "Study system" as system {
usecase "LogIn" as LogIn
usecase "LogOut" as LogOut
usecase "CourseManagement" as CourseManagement
usecase "ReportSubmittal" as ReportSubmittal
usecase "Notify" as Notify
usecase "CourseDropping" as CourseDropping
usecase "FullTimeCourseSearch" as FullTimeCourseSearch
usecase "DistanceStudyCourseSearch" as DistanceStudyCourseSearch
}
' Connections between actors and usecases
teacher -r- LogIn
teacher -r- LogOut
teacher -r- Notify
teacher -r- CourseManagement
external_teacher -- ReportSubmittal
@enduml
Don't forget to check:
Gherkin
Feature: Google Searching
As a web surfer, I want to search Google, so that I can learn new things.
Scenario: Simple Google search
Given a web browser is on the Google page
When the search phrase "panda" is entered
Then results for "panda" are shown
@startuml
skinparam packageStyle rect
' Define actors
actor "Teacher" as teacher
actor "Student" as student
actor "Internal Teacher" as internal_teacher
actor "External Teacher" as external_teacher
rectangle "Study system" as system {
usecase "CourseManagement" as CourseManagement
usecase/ CourseEnrollment as "CourseEnrollment\n---\n**Extension Point**\nExceededCapacity"
usecase "ReportSubmittal" as ReportSubmittal
usecase "Notify" as Notify
usecase/ "CourseSearch" as CourseSearch
usecase "CourseDropping" as CourseDropping
usecase "FullTimeCourseSearch" as FullTimeCourseSearch
usecase "DistanceStudyCourseSearch" as DistanceStudyCourseSearch
}
Notify ..> CourseEnrollment : <<extends>>
CourseManagement ..> CourseSearch : <<include>>
CourseEnrollment ..> CourseSearch : <<include>>
CourseDropping ..> CourseSearch : <<include>>
teacher <|-right- internal_teacher
teacher <|-right- external_teacher
CourseSearch <|-- FullTimeCourseSearch
CourseSearch <|-- DistanceStudyCourseSearch
@enduml
## Use Case ID
1
## Brief description
UC1 allows student to be electronically enrolled in the course.
## Primary Actors
Student
## Secondary Actors
Teacher
## Preconditions
Student is logged in the system
## Main flow
- 1 UC is evoked, once Student selects "Course Enrollment" in the menu.
- 2 INCLUDE(CourseSearch)
- 3 IF at least one course was found
- 3.1 FOR EACH (course found, which has not reached full capacity yet)
- 3.1.1 System displays actual number of enrolled students and offers "Enroll in the course"
- 3.2 IF Student selects "Enroll in the course"
- 3.2.1 System enrolls Student in the course
EXTENSION POINT(FullCapacityReached)
- 3.2.2 System confirms successful enrollment in the course and updates
number of enrolled students in the course.
## Post conditions
List of enrolled students in the course is updated.
## Alternative flow
Student may leave the page anytime by selecting "Back to the previous
page" or by logging out of the system.
Don't forget to check:
Don't forget to check:
concept not implementation
domain oriented - one time, next time
meaningful name
business functions (2-10)
keep number of relations low
focus on relations between objects
@startuml
' hide the spot
hide circle
class Car
Driver "1" - "1..*" Car : drives >
Car "*" - "4" Wheel : have >
Car "0..*" -- "0..*" Person : < owns
@enduml
based on domain
reference to other object in that class
contains
navigability (who owns refference)
name
multiplicity
multiplicities
1:1
@startuml
class Student {
Name
}
Student "0..*" - "1..*" Course
(Student, Course) .. Enrollment
class Enrollment {
drop()
cancel()
}
@enduml
use camelCase() methods
Don't forget to check:
Wrapping it up
https://martinfowler.com/bliki/DomainDrivenDesign.html
https://martinfowler.com/bliki/UbiquitousLanguage.html
Your
own?
https://martinfowler.com/bliki/AnemicDomainModel.html
Aggregate
https://martinfowler.com/bliki/DDD_Aggregate.html
Don't forget to check:
Entity-relationship diagram
https://plantuml.com/ie-diagram
@startuml
' hide the spot
hide circle
' avoid problems with angled crows feet
skinparam linetype ortho
entity "Entity01" as e01 {
*e1_id : number <<generated>>
--
*name : text
description : text
}
entity "Entity02" as e02 {
*e2_id : number <<generated>>
--
*e1_id : number <<FK>>
other_details : text
}
entity "Entity03" as e03 {
*e3_id : number <<generated>>
--
e1_id : number <<FK>>
other_details : text
}
e01 ||..o{ e02
e01 |o..o{ e03
@enduml
https://devdojo.com/tnylea/understanding-polymorphic-relationships
Eloquent, Doctrine, ActiveRecord, TypeORM
Active record pattern
<?php
namespace App\Models;
class Post extends Model
{
/**
* One to Many relation
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo(User::class);
}
/**
* One to Many relation
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function comments()
{
return $this->hasMany(Comment::class);
}
}
class Post {
/**
* @var string
*
* @ORM\Column(type="string")
* @Assert\NotBlank
*/
private $title;
/**
* @var string
*
* @ORM\Column(type="string")
*/
private $slug;
}
part = new Post()
part.name = "Sample post"
part.slug = "sample-post"
part.save()
https://stackoverflow.com/a/30462400
https://devforth.io/blog/why-your-software-should-use-uuids
Don't forget to check:
Implementation
class Car:
def __init__(self, engine):
self.engine = engine
class Engine:
def __init__(self):
pass
engine = Engine()
car = Car(engine) # Ak zmazeme Auto, motor môze stále existovať
class Book:
def __init__(self):
page1 = Page('This is content for page 1')
page2 = Page('This is content for page 2')
self.pages = [page1, page2]
class Page:
def __init__(self, content):
self.content = content
book = Book() # Ak zmazeme knihu zmazeme aj Page
Revízia asociácií 1:1
Revízia asociácií M:1
Rozklad asociácií M:N
Interface
Rozhranie (Interface) je špeciálny typ, ktorý definuje množinu verejných metód, atribútov a vzťahov, ale neobsahuje ich implementáciu. Používa sa na definíciu kontraktu.
CQRS, Event Sourcing
Don't forget to check:
class Project(authGuard: AuthGuard):
def edit(name: string, visibility: bool):
if this.authGuard.user.role != 'autor':
raise UnAuthorizedOperation('Get the...')
this.name = name
this.visibility = visibility
Made of
Syntax: udalosť [podmienka] / akcia
Stavový diagram nemusí reprezentovať kód
Prečo tu riešime pickup date?
používa sa neskôr pri nejakom prechode takže nás zaujíma, čo sa s ním deje
From Design diagram to State diagram
Region
Notice: Nemusíme mať final node
Dobré stavy
Zlé stavy
@startuml
scale 600 width
[*] -> State1
State1 --> State2 : Succeeded
State1 --> [*] : Aborted
State2 --> State3 : Succeeded
State2 --> [*] : Aborted
state State3 {
state "Accumulate Enough Data\nLong State Name" as long1
long1 : Just a test
[*] --> long1
long1 --> long1 : New Data
long1 --> ProcessData : Enough Data
}
State3 --> State3 : Failed
State3 --> [*] : Succeeded / Save Result
State3 --> [*] : Aborted
@enduml
Interakcie
Something like black images shown previously
Focus on time similar to flame graph, communication between classes
LinkedIn is like a reverse dating site. Girls write to you and you ignore them. Just show them you know CQRS, they melt
@startuml
skinparam linestyle ortho
rectangle "A" as one
rectangle "B" as two
rectangle "C" as three
rectangle "D" as four
one -right-> two: message 1-->2
two -right-> three: message 2-->3
two --> four: message 2-->4
three -[hidden]- four
@enduml
Loop, conditions, parallelism
@startuml
autonumber 1.1.1
Alice -> Bob: Authentication request
Bob --> Alice: Response
autonumber inc A
'Now we have 2.1.1
Alice -> Bob: Another authentication request
Bob --> Alice: Response
autonumber inc B
'Now we have 2.2.1
Alice -> Bob: Another authentication request
Bob --> Alice: Response
autonumber inc A
'Now we have 3.1.1
Alice -> Bob: Another authentication request
autonumber inc B
'Now we have 3.2.1
Bob --> Alice: Response
@enduml
For halp
+ Triedy, ktoré sme pridali v Návrhovom
Riešime závislosti a logické celky na úrovni kódu
Kompaktný mód
Náš mód
Riešime architektonické časti systému
Riešime nasadenie komponentov
20 otázok, každá po 0.5 boda 20min/30min teiresias.