Feedback? Den Rda Trden KRAV Vi kan vlja utvecklingsmodell DESIGN - - PowerPoint PPT Presentation

feedback den r da tr den
SMART_READER_LITE
LIVE PREVIEW

Feedback? Den Rda Trden KRAV Vi kan vlja utvecklingsmodell DESIGN - - PowerPoint PPT Presentation

Feedback? Den Rda Trden KRAV Vi kan vlja utvecklingsmodell DESIGN Vi kan hantera risk och vet varfr behvs IMPLEMENT VISION Vi kan skriva och estimera krav TEST User stories, -ilities, regler


slide-1
SLIDE 1

Feedback?

slide-2
SLIDE 2

Den Röda Tråden

  • Vi kan välja utvecklingsmodell
  • Vi kan hantera risk och vet varför behövs
  • Vi kan skriva och estimera krav
  • User stories, -ilities, regler
  • Vi kan ta fram arkitekturkrav
  • Vi kan ta fram arkitektur

VISION KRAV TEST KOD SYSTEM KRAV KRAV TEST TEST DEPLOYABLE … TEST … … KOD KOD … KOD KOD … DEPLOYABLE … KOD … KRAV DESIGN IMPLEMENT TEST DRIFTSÄTTN

slide-3
SLIDE 3

google define: design

google define: design “the act of working out the form

  • f something”
slide-4
SLIDE 4

Vad är design?

slide-5
SLIDE 5

Incremental Design Evolutionary Design Emergent Design

http://www.ibm.com/developerworks/library/j-eaed1/

slide-6
SLIDE 6

Incremental Design

  • 1. Välj ett problem
  • 2. Lös det på enklast möjliga sätt
  • 3. Förenkla och tydliggör (Abstrahera,

Generalisera)

  • 4. Gå till 1
slide-7
SLIDE 7

Hur tar vi fram en arkitektur?

Utgå från vetenskapligt sätt

  • 1. Sätt upp hypotes - kandidatarkitektur!
  • 2. Testa hypotesen utifrån arkitekturellt signifikanta

user stories och -ilities-scenarion.

  • 3. Förändra hypotesen om den inte håller!
slide-8
SLIDE 8

Designelement

Metod Klass Komponent Tjänst Etc…

slide-9
SLIDE 9

För vem?

slide-10
SLIDE 10

Designprinciper

– Abstraction – Decomposition and modularization – Coupling and Cohesion – Encapsulation and information hiding – Consistency (Ubiquituous language)

slide-11
SLIDE 11

Encapsulation vs information hiding

Encapsulation Bundling methods with data Does not mandate private data Information hiding (David Parnas 1972) Private data Hiding not only data but changes in design and/or implementation

http://www.javaworld.com/article/ 2075271/core-java/encapsulation-is-not- information-hiding.html

slide-12
SLIDE 12

Designprinciper

– Reveal Intent - Naming – SRP: Single Responsibility Principle

  • One and one reason only to change

– DRY: Don’t Repeat Yourself

  • Duplication: Missed opportunity for

abstraction!

– KISS: Keep it simple, stupid! – YAGNI: You ain’t gonna need it!

slide-13
SLIDE 13

Analysis Paralysis

No one gets it right the first time!

slide-14
SLIDE 14
slide-15
SLIDE 15

Design pattern

“Each pattern describes a problem that

  • ccurs over and over again in our

environment, and then describes the core

  • f the solution to that problem...”

Christopher Alexander

slide-16
SLIDE 16

Design pattern

A pattern is a solution to a problem within a certain context that has a set of predictable consequences. Ted Neward

https://dzone.com/articles/reclaiming-design-patterns-20-years-later

slide-17
SLIDE 17

Software Design Pattern

  • “a general reusable solution to a

commonly occurring problem within a given context”

http://en.wikipedia.org/wiki/Software_design_pattern

slide-18
SLIDE 18

Men framförallt:

  • Design patterns ger oss ett precist

språk!

  • “Begreppsmodell för domänen

software engineering”

slide-19
SLIDE 19

GoF

– Creational

  • Builder,
  • Factory method, …

– Structural

  • Adapter, Decorator, …

– Behavioral

  • Iterator, Observer, …

“workarounds for missing features in C++”?

slide-20
SLIDE 20

GoF

“Design patterns provide a common vocabulary for designers to use to communicate, document, and explore design alternatives. Design patterns make a system seem less complex by letting you talk about it at a higher level of abstraction than that of a design notation or programming language. Design patterns raise the level at which you design and discuss design with your colleagues.”

slide-21
SLIDE 21

Design patterns

Factory vs Builder

slide-22
SLIDE 22

Static Factory Method

Se also: – http://stackoverflow.com/questions/929021/what-are-static-factory- methods-in-java – http://stackoverflow.com/questions/13029261/design-patterns-factory-vs- factory-method-vs-abstract-factory

Static Factory Method is not Factory, Factory method or Abstract Factory When: Creation is a bit complex for constructor. Then: Create a static method that returns an instance of a class “Static factory method is simply a static method that returns an instance of a class” Effective Java by Joshua Bloch

slide-23
SLIDE 23

Builder

– http://en.wikipedia.org/wiki/Builder_pattern

When: Creation is a bit complex for constructor, and even static factory method; several input parameters and/or several optionals leading to multiple variations of constructors. Then: Create a fluent interface Builder that takes each parameter one by one and then returns an instance of a class in a single step.

slide-24
SLIDE 24

Builder

– http://en.wikipedia.org/wiki/Builder_pattern

slide-25
SLIDE 25

Data persistence patterns

SRP: Separate logic and persistence!

  • DAO
  • CRUD for one entity
  • Repository
  • CRUD* for aggregate: entity and it’s abstractions
  • *Not actually CRUD, but methods reflecting

domain

slide-26
SLIDE 26

Pattern Language

“A pattern language is a method of describing good design practices within a field of expertise”

http://en.wikipedia.org/wiki/Pattern_language

slide-27
SLIDE 27

Tactical DDDesign patterns

– DDD Pattern language!

https://domainlanguage.com/ddd/patterns/DDD_Reference_2011-01-3

slide-28
SLIDE 28

Strategic DDDesign patterns

– DDD Pattern language!

https://domainlanguage.com/ddd/patterns/DDD_Reference_2011-01-3

slide-29
SLIDE 29

Exempel e-handel

  • REST
  • Layers
  • infrastructure (persistence + resources)
  • (application)
  • domain
  • Static factory method
  • Adapter (Resource)
  • Repository (Katalog)
  • Singleton