systematic architect

75
Systematyczny architekt na Systematyczny architekt na drodze ku planowanemu drodze ku planowanemu postarzaniu postarzaniu

Upload: magda3695

Post on 01-Jul-2015

56 views

Category:

Technology


1 download

DESCRIPTION

,

TRANSCRIPT

Page 1: Systematic architect

Systematyczny architekt na Systematyczny architekt na drodze ku planowanemu drodze ku planowanemu postarzaniupostarzaniu

Page 2: Systematic architect

O mnie : Jarosław Pałka

Page 3: Systematic architect

• chief architect @ Lumesse• owner/founder/one man orchestra @

symentis.pl• blogger @ geekyprimitives.wordpress.com• philosopher @ twitter:j_palka• code mangler @ bitbucket:kcrimson &

github:jpalka• evil emperor @ 4developers conf/architecture

track• restrained Padawan @ church of JVM

Page 4: Systematic architect
Page 5: Systematic architect

„Created weakness for the numbers on the board

Absurd amount of things, obsolete creation

The lust for always more, indulgence in hunger

A greed for power, the demon needs to feed

Designed for failure”Gojira – Planned Obsolescence

Page 6: Systematic architect

„strategia producenta, mająca na celu takie projektowanie towarów, aby miały one ograniczony czas użytecznego życia, po tym zaś okresie stawały się niesprawne, a często nieopłacalne w naprawie. Towary te zwykle psują się zaraz po upływie gwarancji.”

Wikipedia

Page 7: Systematic architect
Page 8: Systematic architect

Techniki „planowanego” postarzania

… nowy lepszy paradygmat …… nowa wersja biblioteki …

… nowy język programowania …… nowe lepsze API ...

… brak kompatybilności wstecznej …

Page 9: Systematic architect

Jakby tego było mało

trendy

Page 10: Systematic architect

„We are fashion industry”Uncle Bob

Page 11: Systematic architect

Rewrite

Offload

Modernization

Next Generation Something™

Page 12: Systematic architect

Kilka lat później

Page 13: Systematic architect

Rewrite

Offload

Modernization

Next Generation Something™

Page 14: Systematic architect

Organizacje dostają wysypki na samą myśl o kolejnym

offload, rewrite, NG projekcie

Page 15: Systematic architect

Dobry inżynier,Idź szukaj business value,szukaj

Page 16: Systematic architect

Podejście Big-Bang

Uczymy się na żywym organizmie

Ludzie z businessu trzymają się na dystans

Brak zrozumienia domeny problemu

Page 17: Systematic architect
Page 18: Systematic architect

„It is up to us to live up to the legacy that was left for us, and to leave a legacy that is worthy of our children and of future generations.”

Christine Gregoire

Page 19: Systematic architect

Nie naprawimy przeszłości,Ale możemy uczynić przyszłość lepszą

Page 20: Systematic architect

Mózg, cobędziemy dziś robić?

Page 21: Systematic architect

Dodamy kolejny framework!

Page 22: Systematic architect

Przygotujmy się na lepszą przyszłość

Przygotujmy się na zmiany

Page 23: Systematic architect

Abstrakcje

Page 24: Systematic architect

Posługujemy się nimi na co dzień

Są zapisane w naszej podświadomości

Dlatego tak trudno o nich rozmawiać

Page 25: Systematic architect

Polimorfizm

Page 26: Systematic architect

Znaczenie ukryte za fasadą słów

Page 27: Systematic architect
Page 28: Systematic architect
Page 29: Systematic architect
Page 30: Systematic architect

„Czy mógłbyś otworzyć zamek?”

Brak jednoznaczności abstrakcji

Page 31: Systematic architect

Znaczenie = abstrakcja(kontekst)

Page 32: Systematic architect

public interface TalkingAboutAbstractions{

public void createEmployee(String candidate);

}

Page 33: Systematic architect

public vois hireCandidate(){

String candidate = "Jan Kowalski";employeeBean.createEmployee(candidate);

candidate = "<candidate><id>123456</id></candidate>";

employeeBean.createEmployee(candidate);

candidate = "{ candidate : {id : \"123456\"} }";employeeBean.createEmployee(candidate);

}

Page 34: Systematic architect

public interface TalkingAboutAbstractions{

public Employee hireCandidate(Supplier<Candidate >candidate);

}

Page 35: Systematic architect

public interface GuessWhatIHaveInMind{

String serverStatus() throws Exception;

}

Page 36: Systematic architect

„OK”

„Mam si dobrzeę ”

„Cholera gdzie jest dysk?”

„Daj mi spokoój”

„!@#$%^&*()”

Page 37: Systematic architect

public interface GuessWhatIHaveInMind{

public enum ServerStatus { OK, BUSY, INTERNAL_ERROR }

ServerStatus serverStatus() throws Exception;

}

Page 38: Systematic architect

A teraz czas na coś z klasyki

Prawdziwy, Autentyczny,

jedyny

Page 39: Systematic architect

Brainfuck

Page 40: Systematic architect

public class BrainFuck extends GenericHibernateDAO{

List<Object[]> processList(String target, Long id);

}

Page 41: Systematic architect

public class BrainFuck extends GenericHibernateDAO{

ResultSet processList(String target, Long id);

}

Page 42: Systematic architect

Use types, Luke!

Page 43: Systematic architect

Buisness logic &

system construction&

code infrastructure

Page 44: Systematic architect

public class SoftwareConstruction<K,V> implements BeanFactoryAware, DisposableBean {

@Override @SuppressWarnings("unchecked") public void setBeanFactory(final BeanFactory beanFactory) throws BeansException

{ consumerConfigurations = (Map<String, ConsumerConfiguration<K,V>>) (Object) ((ListableBeanFactory) beanFactory).getBeansOfType(ConsumerConfiguration.class); }

}

Page 45: Systematic architect

Nie mieszajmy odpowiedzialności

Odpowiedzialność to nie tylko „business features”

Obiekt nie może być odpowiedzialny za skonstruowanie samego siebie

Page 46: Systematic architect

public interface ShowMeMore{

@GETpublic Response getRoot(

@Context HttpServletRequest request);

}

Page 47: Systematic architect

public class ShowMeMoreImpl implements ShowMeMore{

@Contextprivate HttpServletRequest request;

@GETpublic Response getRoot();

}

Page 48: Systematic architect

Struktura systemu

Page 49: Systematic architect

Gęstość informacji

Page 50: Systematic architect

„Hierarchies are brilliant systems inventions, not only because they give a systemstability and resilience, but also because they reduce the amount of information thatany part of the system has to keep track of.”

Page 51: Systematic architect

„Hierarchies are brilliant systems inventions, not only because they give a systemstability and resilience, but also because they reduce the amount of information thatany part of the system has to keep track of.”

Page 52: Systematic architect

„In hierarchical systems relationships within each subsystem are denser and strongerthan relationships between subsystems. Everything is still connected to everythingelse, but not equally strongly.”

Page 53: Systematic architect

„In hierarchical systems relationships within each subsystem are denser and strongerthan relationships between subsystems. Everything is still connected to everythingelse, but not equally strongly.”

Page 54: Systematic architect

„Hierarchical systems are partially decomposable. Their subsystems with theirespecially dense information links can function at least partially as systems in theirown right. When hierarchies break down, they usually split along their subsystemboundaries”

Donella Meadows

Page 55: Systematic architect

„Hierarchical systems are partially decomposable. Their subsystems with theirespecially dense information links can function at least partially as systems in theirown right. When hierarchies break down, they usually split along their subsystemboundaries”

Page 56: Systematic architect
Page 57: Systematic architect

Value is Your Subsystem Boundary

Page 58: Systematic architect

Kandydat

Page 59: Systematic architect

Aplikant

Kandydat

Page 60: Systematic architect

Aplikant

Kandydat

Bezrobotny

Page 61: Systematic architect

Aplikant

Kandydat

Bezrobotny

Page 62: Systematic architect

Value is usually

Your subsystem boundary

Page 63: Systematic architect

„Encapsulation is the packing of data and functions into a single component.”

Page 64: Systematic architect

„Hierarchies are brilliant systems inventions, not only because they give a systemstability and resilience, but also because they reduce the amount of information thatany part of the system has to keep track of.”

Page 65: Systematic architect

public class WrongEncapsulation{public String name;

}

Page 66: Systematic architect

public class IsItEncapsulation{private String name;

}

Page 67: Systematic architect

public class JavaStyleEncapsulation{

private String name;

public String getName(){ ... };

public void setName(String name){ …

};

}

Page 68: Systematic architect

Software design porn

Page 69: Systematic architect

public class AnotherStylishClass{

private List<String> strings = new ArrayList<>();

public List<String> getStrings(){return strings;

}

AnotherStylishCase obj = new AnotherStylishCase();

obj.getStrings().add("Hello leaky abstraction!");

}

Page 70: Systematic architect

… Jakie są granice szaleństwa ...

Page 71: Systematic architect

… Jakie są granice szaleństwa ...

Page 72: Systematic architect

Kiedy znowu zobaczysz Java Bean,usuń go,

poważnie,natychmiast,

git rm AnotherStupidJavaBean.java

Page 73: Systematic architect

Jedyne rzeczy które warto zapamiętać

Page 74: Systematic architect

AbstrakcjePolimorfizm

Context is King

Gęstość informacjiEnkapsulacja

Hierarchical Systems

Software construction vs

business logic

Page 75: Systematic architect