SlideShare a Scribd company logo
1 of 80
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
„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
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
„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
„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”
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

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - 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 Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
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
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
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...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - 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
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
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
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
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...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Systematyczny architekt na drodze ku planowanemu postarzaniu