18
AGILE AND AUTOMATION CONCLAVE 2018 Applied Design Patterns A Compiler Case Study Ganesh Samarthyam CodeOps Technologies LLP

AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

AGILE AND AUTOMATION CONCLAVE 2018

Applied Design PatternsA Compiler Case StudyGanesh Samarthyam

CodeOps Technologies LLP

Page 2: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

• Entrepreneur – Co-founder, CodeOps technologies• Book Author – “Refactoring for Software Design

Smells” (translated to languages like Chinese & Korean)

• Community Contributor – Organizer of popular tech meetups & conferences

• Simple Programmer – That’s the day job! J

Page 3: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Design PatternsDeveloper view on design patterns is surprisingly polarizing: • Some swear by its usefulness • Some find it really complicated or outdated or

irrelevant for modern software development • Most are clueless about how to apply them

for creating effective designs!

Page 4: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Compiler Case Study: What you need to know

• Understand essential object oriented constructs such as runtime polymorphism (virtual functions), and principles (such as encapsulation)

• Know essential C# or Java language features - classes, inheritance, etc.

• Data structures and algorithms (especially binary trees, tree traversals, and stacks)

• NO background in compilers needed • Extremely simplified compiler code example; purposefully done to make best

use of this case study

Page 5: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Let’s Just Code!

Image Source: https://pixabay.com/en/code-geek-talk-code-to-me-coffee-cup-2680204/ (CC0 No Attribution Required)

Page 6: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Switch-case to runtime polymorphism

Page 7: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Simplify object creation

Page 8: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Reuse “fine-grained” objects

Page 9: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Externalizing iteration concern

Page 10: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Isolating platform dependencies

Page 11: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Isolating platform dependencies

Page 12: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Primitives to objects

Page 13: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Switch-case for operations

Page 14: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Isolating platform dependencies

Page 15: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Key Technical Points

Design patterns are quite relevant for Agile development

The key to effective design is to apply design principles

Design patterns result from proactively applying design principles

Often design patterns emerge naturally when refactoring smells

Page 16: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Supporting Source Code • https://github.com/CodeOpsTech/CompilerDesignPatternsCSharp (C# examples) • https://github.com/CodeOpsTech/DesignPatternsJava (Java examples)

Page 17: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

Q&A

Page 18: AGILE AND AUTOMATION CONCLAVE 2018€¦ · Agile and Automation Conclave 2018 •Entrepreneur –Co-founder, CodeOps technologies •Book Author –“Refactoring for Software Design

Agile and Automation Conclave 2018

FOLLOW USLinkedIn – SolutionsIQ India | Twitter – SIQIndia | Facebook – SolutionsIQ India

Ganesh [email protected]