Systematyczny architekt na drodze ku planowanemu postarzaniu

Jaroslaw Palka
Jaroslaw PalkaChief Architect at Lumesse (formerly known as StepStone Solutions)
Systematyczny architekt naSystematyczny architekt na
drodze ku planowanemudrodze ku planowanemu
postarzaniupostarzaniu
O mnie :
Jarosław Pałka
Who am I?
Journeyman through
space,
time
and
technology
devoted follower in church of JVM
chief architect @ Lumesse
owner/founder @ symentis.pl
blogger @ geekyprimitives.wordpress.com
philosopher @ twitter:j_palka
code mangler @ bitbucket:kcrimson &
github:jpalka
Systematyczny architekt na drodze ku planowanemu postarzaniu
„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
„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
Systematyczny architekt na drodze ku planowanemu postarzaniu
Techniki „planowanego” postarzania
… najlepiej na wczoraj …
… się poprawi jutro …
(jutro nie nadejdzie nigdy)
… to tylko prototyp …
(żartowaliśmy)
… nie mamy czasu …
Jakby tego było mało
trendy
„We are fashion industry”
Uncle Bob
Rewrite
Offload
Modernization
Next Generation Something™
Kilka lat później
Rewrite
Offload
Modernization
Next Generation Something™
I znowy trzeba przepisać
Dobry inżynier,
Idź szukaj business
Podejście Big-Bang
Uczymy się na żywym organizmie
Ludzie z businessu trzymają się na dystans
Brak zrozumienia domeny problemu
Systematyczny architekt na drodze ku planowanemu postarzaniu
„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
Nie naprawimy przeszłości,
Ale możemy uczynić przyszłość lepszą
Mózg, co
będziemy
dziś robić?
Dodamy kolejny framework!
Przygotujmy się na lepszą przyszłość
Przygotujmy się na zmiany
Abstrakcje
Posługujemy się nimi na co dzień
Są zapisane w naszej podświadomości
Dlatego tak trudno o nich rozmawiać
Znaczenie ukryte za fasadą słów
Systematyczny architekt na drodze ku planowanemu postarzaniu
Systematyczny architekt na drodze ku planowanemu postarzaniu
Systematyczny architekt na drodze ku planowanemu postarzaniu
„Czy mógłbyś otworzyć zamek?”
Brak jednoznaczności abstrakcji
Znaczenie = abstrakcja(kontekst)
Polimorfizm
public interface TalkingAboutAbstractions{
public void createEmployee(String candidate);
}
public voishireCandidate(){
String candidate= "Jan Kowalski";
employeeBean.createEmployee(candidate);
candidate=
"<candidate><id>123456</id></candidate>";
employeeBean.createEmployee(candidate);
candidate= "{ candidate: {id : "123456"} }";
employeeBean.createEmployee(candidate);
}
public interface TalkingAboutAbstractions{
public Employee
hireCandidate(Supplier<Candidate>candidate);
}
public interface GuessWhatIHaveInMind{
String serverStatus() throws Exception;
}
„ ”OK
„ ”Mam się dobrze
„ ”Cholera gdzie jest dysk?
„ ”Daj mi spokój
„! # %^&*()”@ $
public interface GuessWhatIHaveInMind{
public enumServerStatus{ OK, BUSY, INTERNAL_ERROR }
ServerStatusserverStatus() throws Exception;
}
A teraz czas na coś z klasyki
Prawdziwy,
Autentyczny,
jedyny
Brainfuck
public class BrainFuckextends GenericHibernateDAO{
List<Object[]> processList(String target, Long id);
}
public class BrainFuckextends GenericHibernateDAO{
ResultSet processList(String target, Long id);
}
Use types, Luke!
„Mieć” i „być”, to nie to samo
Diabeł tkwi w szczegółach
Generalizacja, uogólnienie
„is-a”
Kompozycja, delegacja
„has-a”
Uogólniaj na poziomie kontraktu
Interfejsu ze światem zewnętrznym
Kompozycja i delegacja
gdy przychodzi czas
na
Szczegóły implementacji
Stosuj obie techniki świadomie,
Polimorfizm przychodzi
W
wielu smakach
(dziedziczenie to tylko jeden z nich)
„Ad hoc”
„Parametric”
„Coercion”
Buisness logic
system construction
code infrastructure
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);
}
}
Nie mieszajmy odpowiedzialności
Odpowiedzialność to nie tylko
„business features”
Obiekt nie może być odpowiedzialny za
skonstruowanie samego siebie
public AlbumPage(PageParametersparameters) {
super(parameters);
boolean showDescription = false;
List<AlbumFullViewDTO> albums;
String searchQuery = parameters.get("search").toString(null);
if (searchQuery == null) {
searchQuery = parameters.get(0).toString(null);
if (searchQuery != null) {
showDescription = true;
}
}
albums= productCatalog.searchAlbums(searchQuery);
ListView<AlbumFullViewDTO> albumsListView = new AlbumsListView(
ID_ALBUMS_VIEW, albums, showDescription);
add(albumsListView);
}
public interface ShowMeMore{
@GET
public ResponsegetRoot(
@Context HttpServletRequest request);
}
public class ShowMeMoreImpl implements ShowMeMore{
@Context
private HttpServletRequest request;
@GET
public ResponsegetRoot();
}
Struktura systemu
Gęstość informacji
„Hierarchies are brilliant systems inventions, 
not only because they give a system
stability and resilience, but also because they 
reduce the amount of information that
any part of the system has to keep track of.”
„Hierarchies are brilliant systems inventions, 
not only because they give a system
stability and resilience, but also because they 
reduce the amount of information that
any part of the system has to keep track of.”
„In hierarchical systems relationships within 
each subsystem are denser and stronger
than relationships between subsystems. 
Everything is still connected to everything
else, but not equally strongly.”
„In hierarchical systems relationships within 
each subsystem are denser and stronger
than relationships between subsystems. 
Everything is still connected to everything
else, but not equally strongly.”
„Hierarchical systems are partially 
decomposable. Their subsystems with their
especially dense information links can 
function at least partially as systems in their
own right. When hierarchies break down, they 
usually split along their subsystem
boundaries”
Donella Meadows
„Hierarchical systems are partially 
decomposable. Their subsystems with their
especially dense information links can 
function at least partially as systems in their
own right. When hierarchies break down, they 
usually split along their subsystem
boundaries”
Systematyczny architekt na drodze ku planowanemu postarzaniu
Value is Your Subsystem Boundary
Kandydat
Aplikant
Kandydat
Aplikant
Kandydat
Bezrobotny
Aplikant
Kandydat
Bezrobotny
Value is
usually
Your subsystem boundary
„Encapsulation is the packing 
of data and functions into a 
single component.”
„Hierarchies are brilliant systems inventions, 
not only because they give a system
stability and resilience, but also because they 
reduce the amount of information that
any part of the system has to keep track of.”
public class WrongEncapsulation{
public String name;
}
public class IsItEncapsulation{
private String name;
}
public class JavaStyleEncapsulation{
private String name;
public String getName(){ ... };
public void setName(String name){
…
};
}
Software design porn
public class AnotherStylishClass{
private List<String> strings= new ArrayList<>();
public List<String> getStrings(){
returnstrings;
}
AnotherStylishCaseobj = new AnotherStylishCase();
obj.getStrings().add("Hello leaky abstraction!");
}
Testability
the ultimate UI
If it's hard to test
it will be hard to maintain
and even harder to rewrite
„somebody on the internet”
… Jakie są granice szaleństwa ...
Kiedy znowu zobaczysz Java Bean,
usuń go,
poważnie,
natychmiast,
.git rm AnotherStupidJavaBean java
Jedyne rzeczy które warto zapamiętać
Abstrakcje
Polimorfizm
Context is King
Gęstość informacji
Enkapsulacja
Hierarchical Systems
Software construction
Systematyczny architekt na drodze ku planowanemu postarzaniu
1 of 80

Recommended

[QE 2015] Jarosław Pałka - Systematyczny architekt na drodze ku planowanemu p... by
[QE 2015] Jarosław Pałka - Systematyczny architekt na drodze ku planowanemu p...[QE 2015] Jarosław Pałka - Systematyczny architekt na drodze ku planowanemu p...
[QE 2015] Jarosław Pałka - Systematyczny architekt na drodze ku planowanemu p...Future Processing
594 views80 slides
Patterns for JVM languages JokerConf by
Patterns for JVM languages JokerConfPatterns for JVM languages JokerConf
Patterns for JVM languages JokerConfJaroslaw Palka
1.1K views67 slides
I ty też możesz mieć swoje dane w cache by
I ty też możesz mieć swoje dane w cacheI ty też możesz mieć swoje dane w cache
I ty też możesz mieć swoje dane w cacheJaroslaw Palka
1.1K views116 slides
Czterej jeźdźcy apokalipsy gdy Armagedon w JVM nadchodzi by
Czterej jeźdźcy apokalipsy  gdy Armagedon w JVM nadchodziCzterej jeźdźcy apokalipsy  gdy Armagedon w JVM nadchodzi
Czterej jeźdźcy apokalipsy gdy Armagedon w JVM nadchodziJaroslaw Palka
2.1K views70 slides
Systematyczny architekt na drodze ku planowanemu postarzaniu by
Systematyczny architekt na drodze ku planowanemu postarzaniuSystematyczny architekt na drodze ku planowanemu postarzaniu
Systematyczny architekt na drodze ku planowanemu postarzaniuJaroslaw Palka
921 views75 slides
Programming and architecture of NOSQL web at 33degree by
Programming and architecture of NOSQL web at 33degreeProgramming and architecture of NOSQL web at 33degree
Programming and architecture of NOSQL web at 33degreeJaroslaw Palka
633 views44 slides

More Related Content

Featured

ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
21.3K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
5.2K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
5.9K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
4.5K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.2K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.7K views42 slides

Featured(20)

ChatGPT and the Future of Work - Clark Boyd by Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd21.3K views
Getting into the tech field. what next by Tessa Mero
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero5.2K views
Google's Just Not That Into You: Understanding Core Updates & Search Intent by Lily Ray
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray5.9K views
Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.7K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.6K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.6K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.4K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.6K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.2K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.3K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views

Systematyczny architekt na drodze ku planowanemu postarzaniu