SlideShare a Scribd company logo
Java and effective programming.
Is it possible?
Łukasz Koniecki
April 14th, 2016
https://github.com/lkoniecki/EffectiveJava
Whoami
•Software Architect in the Dynatrace,
•Worked as Software Developer and Team Lead,
•10+ years of experience with Java – Enterprise
Application mostly,
•Main area of interest: optimization and application
performance
APM
What this workshop is about?
•Showing examples on good, better and the best
solutions to some common design problems,
•Signaling some commons programming anti-
patterns you should avoid,
•Having fun solving simple Java programming puzzles
What this workshop is not about?
•Learning programming from scratch,
•Learning Java from the beginning,
•Solving all possible Java problems
Design
patterns
POJO with multiple instance members
Telescoping constructor pattern
JavaBean pattern
Builder pattern
Example
The moral
• There are many ways of implementing the same algorithm/functionality,
• There are reusable patterns that you should use (on every possible level:
implementation, integration, deployment etc.
Exercise 1
Specification
• Given the lists of strings as an input, method groupBy in the Example1 class
should return map with all strings that occurred in the input list as key and
number of string occurrences as value,
Example:
For a given input list {„John”, „Aaron”, „John” „Adam”, „Adele”} method
should return following map { {„John”, 2}, {„Aaron”, 1}, {„Adam”, 1},
{„Adele”, 1}}
• Method should throw IllegalArgumentException if elements list is null,
• Method should return empty map if elements list is empty.
Functional
programming
Java7-ish vs. stream-like version
But… Is it safe?
Benchmark results
Moral
• Functional programming is more about coding convenience,
• You should not mix imperative and functional programming
styles,
• Developer must be familiar with how streams work and behave
(e.g. parallel stream execution),
• Must be used with caution (see: 10 Subtle Mistakes When Using
the Streams API)
Generics
What you should know about generics?
•Compile time type check rather than runtime check,
•Generic types are invariant (compare with covariant
arrays)
•List<Integer> is not subtype of List<Number>,
•Can be confusing when implementing API contract,
•Use wildcards with caution.
Example
Moral
•Always try to get into your API consumer shoes,
•Remember the rule:
Producer – <? extends V>
Consumer - <? super V>
Exercise 2
Specification
• Implement union method in the Exercise2 class, so that it returns set being
an union of two sets passed as an argument,
• Change it’s definition so that the following line of code compiles
• Method should throw IllegalArgumentException if any set passed as an
argument is null,
• Remember that producer – super, consumer – extends…
Set<Number> result = Excercise2.union(new HashSet<Integer>(), new HashSet<Number>());
Java/C++/Python/JavaScript
is your favorite?
Be the dev we need!
Visit http://gdansk.dynatrace.pl
Credits
•Joshua Bloch - Effective programming in Java (2nd
edition)
•Nicolai Parlog - Stream performance
Java and effective programming. Is it possible? - IAESTE Case Week 2016

More Related Content

What's hot

AspectMock
AspectMockAspectMock
AspectMock
Bryce Embry
 
What's New in C# ? C# 6, 7.0, 7.1 and 7.2
What's New in C# ? C# 6, 7.0, 7.1 and 7.2What's New in C# ? C# 6, 7.0, 7.1 and 7.2
What's New in C# ? C# 6, 7.0, 7.1 and 7.2
David Stevenson
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)
lennartkats
 
Password locker project
Password locker project Password locker project
Password locker project
Md. Shafiuzzaman Hira
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloudlennartkats
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languages
Mikhail Barash
 
Test-driven language development
Test-driven language developmentTest-driven language development
Test-driven language developmentlennartkats
 
c3ee900a-894b-4680-894c-42f77ffd4446-160308162303
c3ee900a-894b-4680-894c-42f77ffd4446-160308162303c3ee900a-894b-4680-894c-42f77ffd4446-160308162303
c3ee900a-894b-4680-894c-42f77ffd4446-160308162303Robert Warren
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
lennartkats
 
Journey with XP a case study in embedded domain by Pradeep Kumar NR
Journey with XP a case study in embedded domain  by Pradeep Kumar NRJourney with XP a case study in embedded domain  by Pradeep Kumar NR
Journey with XP a case study in embedded domain by Pradeep Kumar NR
XP Conference India
 
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for JavaSystematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Michael Reif
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developers
Bert Jan Schrijver
 
How to Create Python scripts
How to Create Python scriptsHow to Create Python scripts
How to Create Python scripts
Md. Shafiuzzaman Hira
 
Java 8 Lambdas
Java 8 LambdasJava 8 Lambdas
Java 8 Lambdas
docupevdv
 
Being Good Developer
Being Good DeveloperBeing Good Developer
Being Good Developer
Sally Ahmed
 
Getting started with scala cats
Getting started with scala catsGetting started with scala cats
Getting started with scala cats
Knoldus Inc.
 
java token
java tokenjava token
java token
Jadavsejal
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
Peter Hendriks
 

What's hot (20)

Java basics training 1
Java basics training 1Java basics training 1
Java basics training 1
 
AspectMock
AspectMockAspectMock
AspectMock
 
What's New in C# ? C# 6, 7.0, 7.1 and 7.2
What's New in C# ? C# 6, 7.0, 7.1 and 7.2What's New in C# ? C# 6, 7.0, 7.1 and 7.2
What's New in C# ? C# 6, 7.0, 7.1 and 7.2
 
Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)Using Aspects for Language Portability (SCAM 2010)
Using Aspects for Language Portability (SCAM 2010)
 
Password locker project
Password locker project Password locker project
Password locker project
 
me-and-python
me-and-pythonme-and-python
me-and-python
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloud
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languages
 
Test-driven language development
Test-driven language developmentTest-driven language development
Test-driven language development
 
c3ee900a-894b-4680-894c-42f77ffd4446-160308162303
c3ee900a-894b-4680-894c-42f77ffd4446-160308162303c3ee900a-894b-4680-894c-42f77ffd4446-160308162303
c3ee900a-894b-4680-894c-42f77ffd4446-160308162303
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
 
Journey with XP a case study in embedded domain by Pradeep Kumar NR
Journey with XP a case study in embedded domain  by Pradeep Kumar NRJourney with XP a case study in embedded domain  by Pradeep Kumar NR
Journey with XP a case study in embedded domain by Pradeep Kumar NR
 
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for JavaSystematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
Systematic Evaluation of the Unsoundness of Call Graph Algorithms for Java
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developers
 
How to Create Python scripts
How to Create Python scriptsHow to Create Python scripts
How to Create Python scripts
 
Java 8 Lambdas
Java 8 LambdasJava 8 Lambdas
Java 8 Lambdas
 
Being Good Developer
Being Good DeveloperBeing Good Developer
Being Good Developer
 
Getting started with scala cats
Getting started with scala catsGetting started with scala cats
Getting started with scala cats
 
java token
java tokenjava token
java token
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 

Viewers also liked

European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)GreenLabCenter
 
Technology, apps, and websites you need to know about
Technology, apps, and websites you need to know aboutTechnology, apps, and websites you need to know about
Technology, apps, and websites you need to know about
Doug Green
 
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Jaak Vlasveld
 
Green-Language programming presentation
Green-Language programming presentationGreen-Language programming presentation
Green-Language programming presentationLorraine Cruz
 
Introduction to the Green Code
Introduction to the Green CodeIntroduction to the Green Code
Introduction to the Green Codebuffalogreencode
 
Green Programming
Green ProgrammingGreen Programming
Green Programming
Grand Rapids Public Library
 
Green Software Lab
Green Software LabGreen Software Lab
Green Software Lab
GreenLabAtDI
 
3.2 System Design For Eco Efficiency
3.2 System Design For Eco Efficiency3.2 System Design For Eco Efficiency
3.2 System Design For Eco EfficiencyLeNS_slide
 
Green it
Green it  Green it
Green it
mashaathukorala
 
Green Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject DetailsGreen Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject Details
Olivier Philippot
 
Towards Software Sustainability Assessment
Towards Software Sustainability AssessmentTowards Software Sustainability Assessment
Towards Software Sustainability Assessment
Patricia Lago
 
Ten green bottles
Ten green bottlesTen green bottles
Ten green bottles
gibertfortuny
 
說服性科技 Persuasive technology
說服性科技 Persuasive technology說服性科技 Persuasive technology
說服性科技 Persuasive technology
Jill Hsu
 
Software and Sustainability
Software and SustainabilitySoftware and Sustainability
Software and Sustainability
Patricia Lago
 
How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01
How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01
How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01
Jérôme Rocheteau
 
Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008
giosissa
 
Green ICT, sustainability and Open Source
Green ICT, sustainability and Open  SourceGreen ICT, sustainability and Open  Source
Green ICT, sustainability and Open Source
giosissa
 
The Green Lab - [01-B] Case study presentation
The Green Lab - [01-B] Case study presentationThe Green Lab - [01-B] Case study presentation
The Green Lab - [01-B] Case study presentation
Giuseppe Procaccianti
 
The Green Lab - [03 A] Experiment planning
The Green Lab - [03 A] Experiment planningThe Green Lab - [03 A] Experiment planning
The Green Lab - [03 A] Experiment planning
Ivano Malavolta
 
The Green Lab - [02 A] The experimental process
The Green Lab - [02 A] The experimental processThe Green Lab - [02 A] The experimental process
The Green Lab - [02 A] The experimental process
Ivano Malavolta
 

Viewers also liked (20)

European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)European Green IT Webinar 2014 - Green Code Lab (France)
European Green IT Webinar 2014 - Green Code Lab (France)
 
Technology, apps, and websites you need to know about
Technology, apps, and websites you need to know aboutTechnology, apps, and websites you need to know about
Technology, apps, and websites you need to know about
 
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...Presentation Joost Visser / SIG - what can be green about software- Workshop ...
Presentation Joost Visser / SIG - what can be green about software- Workshop ...
 
Green-Language programming presentation
Green-Language programming presentationGreen-Language programming presentation
Green-Language programming presentation
 
Introduction to the Green Code
Introduction to the Green CodeIntroduction to the Green Code
Introduction to the Green Code
 
Green Programming
Green ProgrammingGreen Programming
Green Programming
 
Green Software Lab
Green Software LabGreen Software Lab
Green Software Lab
 
3.2 System Design For Eco Efficiency
3.2 System Design For Eco Efficiency3.2 System Design For Eco Efficiency
3.2 System Design For Eco Efficiency
 
Green it
Green it  Green it
Green it
 
Green Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject DetailsGreen Code Lab Challenge 2015 Subject Details
Green Code Lab Challenge 2015 Subject Details
 
Towards Software Sustainability Assessment
Towards Software Sustainability AssessmentTowards Software Sustainability Assessment
Towards Software Sustainability Assessment
 
Ten green bottles
Ten green bottlesTen green bottles
Ten green bottles
 
說服性科技 Persuasive technology
說服性科技 Persuasive technology說服性科技 Persuasive technology
說服性科技 Persuasive technology
 
Software and Sustainability
Software and SustainabilitySoftware and Sustainability
Software and Sustainability
 
How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01
How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01
How Green are Java Best Coding Practices? - GreenDays @ Rennes - 2014-07-01
 
Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008Sissa OSWC Malaga 2008
Sissa OSWC Malaga 2008
 
Green ICT, sustainability and Open Source
Green ICT, sustainability and Open  SourceGreen ICT, sustainability and Open  Source
Green ICT, sustainability and Open Source
 
The Green Lab - [01-B] Case study presentation
The Green Lab - [01-B] Case study presentationThe Green Lab - [01-B] Case study presentation
The Green Lab - [01-B] Case study presentation
 
The Green Lab - [03 A] Experiment planning
The Green Lab - [03 A] Experiment planningThe Green Lab - [03 A] Experiment planning
The Green Lab - [03 A] Experiment planning
 
The Green Lab - [02 A] The experimental process
The Green Lab - [02 A] The experimental processThe Green Lab - [02 A] The experimental process
The Green Lab - [02 A] The experimental process
 

Similar to Java and effective programming. Is it possible? - IAESTE Case Week 2016

Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016
Łukasz Koniecki
 
Learn java theory presentation
Learn java theory presentationLearn java theory presentation
Learn java theory presentation
Mark John Lado, MIT
 
The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practicesBill Buchan
 
Java+8-New+Features.pdf
Java+8-New+Features.pdfJava+8-New+Features.pdf
Java+8-New+Features.pdf
gurukanth4
 
Topic production code
Topic production codeTopic production code
Topic production code
Kavi Kumar
 
A-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
A-Brief-Introduction-To-JAVA8_By_Srimanta_SahuA-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
A-Brief-Introduction-To-JAVA8_By_Srimanta_SahuSrimanta Sahu
 
Code reviews
Code reviewsCode reviews
Code reviewsRoger Xia
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIs
Peter Hendriks
 
How can JAVA Performance tuning speed up applications.pdf
How can JAVA Performance tuning speed up applications.pdfHow can JAVA Performance tuning speed up applications.pdf
How can JAVA Performance tuning speed up applications.pdf
Mindfire LLC
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scala
Paweł Panasewicz
 
Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...
Alain Lompo
 
Cracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 ExamsCracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 Exams
Ganesh Samarthyam
 
More than Programming!
More than Programming!More than Programming!
More than Programming!Sophy Eung
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features Overview
Sergii Stets
 
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
Iosif Itkin
 
Golden Rules of API Design
Golden Rules of API DesignGolden Rules of API Design
Golden Rules of API Design
David Koelle
 
Java Custom Annotations- Part1
Java Custom Annotations- Part1Java Custom Annotations- Part1
Java Custom Annotations- Part1
Mohammad Sabir Khan
 
DAA Unit 1.pdf
DAA Unit 1.pdfDAA Unit 1.pdf
DAA Unit 1.pdf
Nirmalavenkatachalam
 
Core java programming tutorial - Brainsmartlabs
Core java programming tutorial - BrainsmartlabsCore java programming tutorial - Brainsmartlabs
Core java programming tutorial - Brainsmartlabs
brainsmartlabsedu
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIsNLJUG
 

Similar to Java and effective programming. Is it possible? - IAESTE Case Week 2016 (20)

Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016Effective programming in Java - Kronospan Job Fair 2016
Effective programming in Java - Kronospan Job Fair 2016
 
Learn java theory presentation
Learn java theory presentationLearn java theory presentation
Learn java theory presentation
 
The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practices
 
Java+8-New+Features.pdf
Java+8-New+Features.pdfJava+8-New+Features.pdf
Java+8-New+Features.pdf
 
Topic production code
Topic production codeTopic production code
Topic production code
 
A-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
A-Brief-Introduction-To-JAVA8_By_Srimanta_SahuA-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
A-Brief-Introduction-To-JAVA8_By_Srimanta_Sahu
 
Code reviews
Code reviewsCode reviews
Code reviews
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIs
 
How can JAVA Performance tuning speed up applications.pdf
How can JAVA Performance tuning speed up applications.pdfHow can JAVA Performance tuning speed up applications.pdf
How can JAVA Performance tuning speed up applications.pdf
 
Testing practicies not only in scala
Testing practicies not only in scalaTesting practicies not only in scala
Testing practicies not only in scala
 
Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...Designing function families and bundles with java's behaviors parameterisatio...
Designing function families and bundles with java's behaviors parameterisatio...
 
Cracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 ExamsCracking OCA and OCP Java 8 Exams
Cracking OCA and OCP Java 8 Exams
 
More than Programming!
More than Programming!More than Programming!
More than Programming!
 
Java 8 - Features Overview
Java 8 - Features OverviewJava 8 - Features Overview
Java 8 - Features Overview
 
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
TMPA-2015: The Application of Parameterized Hierarchy Templates for Automated...
 
Golden Rules of API Design
Golden Rules of API DesignGolden Rules of API Design
Golden Rules of API Design
 
Java Custom Annotations- Part1
Java Custom Annotations- Part1Java Custom Annotations- Part1
Java Custom Annotations- Part1
 
DAA Unit 1.pdf
DAA Unit 1.pdfDAA Unit 1.pdf
DAA Unit 1.pdf
 
Core java programming tutorial - Brainsmartlabs
Core java programming tutorial - BrainsmartlabsCore java programming tutorial - Brainsmartlabs
Core java programming tutorial - Brainsmartlabs
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
 

Recently uploaded

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Java and effective programming. Is it possible? - IAESTE Case Week 2016

  • 1. Java and effective programming. Is it possible? Łukasz Koniecki April 14th, 2016
  • 3.
  • 4.
  • 5. Whoami •Software Architect in the Dynatrace, •Worked as Software Developer and Team Lead, •10+ years of experience with Java – Enterprise Application mostly, •Main area of interest: optimization and application performance
  • 6. APM
  • 7.
  • 8. What this workshop is about? •Showing examples on good, better and the best solutions to some common design problems, •Signaling some commons programming anti- patterns you should avoid, •Having fun solving simple Java programming puzzles
  • 9. What this workshop is not about? •Learning programming from scratch, •Learning Java from the beginning, •Solving all possible Java problems
  • 11.
  • 12. POJO with multiple instance members
  • 17. The moral • There are many ways of implementing the same algorithm/functionality, • There are reusable patterns that you should use (on every possible level: implementation, integration, deployment etc.
  • 19. Specification • Given the lists of strings as an input, method groupBy in the Example1 class should return map with all strings that occurred in the input list as key and number of string occurrences as value, Example: For a given input list {„John”, „Aaron”, „John” „Adam”, „Adele”} method should return following map { {„John”, 2}, {„Aaron”, 1}, {„Adam”, 1}, {„Adele”, 1}} • Method should throw IllegalArgumentException if elements list is null, • Method should return empty map if elements list is empty.
  • 22. But… Is it safe?
  • 24. Moral • Functional programming is more about coding convenience, • You should not mix imperative and functional programming styles, • Developer must be familiar with how streams work and behave (e.g. parallel stream execution), • Must be used with caution (see: 10 Subtle Mistakes When Using the Streams API)
  • 26. What you should know about generics? •Compile time type check rather than runtime check, •Generic types are invariant (compare with covariant arrays) •List<Integer> is not subtype of List<Number>, •Can be confusing when implementing API contract, •Use wildcards with caution.
  • 28. Moral •Always try to get into your API consumer shoes, •Remember the rule: Producer – <? extends V> Consumer - <? super V>
  • 30. Specification • Implement union method in the Exercise2 class, so that it returns set being an union of two sets passed as an argument, • Change it’s definition so that the following line of code compiles • Method should throw IllegalArgumentException if any set passed as an argument is null, • Remember that producer – super, consumer – extends… Set<Number> result = Excercise2.union(new HashSet<Integer>(), new HashSet<Number>());
  • 31.
  • 32. Java/C++/Python/JavaScript is your favorite? Be the dev we need! Visit http://gdansk.dynatrace.pl
  • 33. Credits •Joshua Bloch - Effective programming in Java (2nd edition) •Nicolai Parlog - Stream performance