architectural changes in orion

37
Modern Architecture for Orion Towards a better source code and faster delivery

Upload: tomas-dermisek

Post on 28-Jan-2018

22 views

Category:

Software


0 download

TRANSCRIPT

Modern Architecture for Orion

Towards a better source code and faster delivery

Orion

The Problem

The solution

The solution

Where is all the code gone?

Smaller and reusable blocks

● easier to understand

● easier to maintain

● increased reusability

● easier to test

Principles to follow

● OOP

● SOLID principles

● Namespaces

● Unit Testing

● Domain Driven Design

Principles to follow

● OOP

● SOLID principles

● Namespaces

● Unit Testing

● Domain Driven Design

Object-oriented Programming

● Encapsulation

● Polymorphism

● Inheritance

● Composition

● Delegation

Principles to follow

● OOP

● SOLID principles

● Namespaces

● Unit Testing

● Domain Driven Design

SOLID Principles

● Single responsibility principle

● Open/closed principle

● Liskov substitution principle

● Interface segregation principle

● Dependency inversion principle

SOLID Principles

● Single responsibility principle

● Open/closed principle

● Liskov substitution principle

● Interface segregation principle

● Dependency inversion principle

SOLID Principles

● Single responsibility principle

● Open/closed principle

● Liskov substitution principle

● Interface segregation principle

● Dependency inversion principle

SOLID Principles

● Single responsibility principle

● Open/closed principle

● Liskov substitution principle

● Interface segregation principle

● Dependency inversion principle

SOLID Principles

● Single responsibility principle

● Open/closed principle

● Liskov substitution principle

● Interface segregation principle

● Dependency inversion principle

SOLID Principles

● Single responsibility principle

● Open/closed principle

● Liskov substitution principle

● Interface segregation principle

● Dependency inversion principle

Dependency Injection Container

Principles to follow

● OOP

● SOLID principles

● Namespaces

● Unit Testing

● Domain Driven Design

Class names before PHP 5.3

Class names after PHP 5.3

Namespaces

Class name with alias

Type of class names:

Autoloading

Principles to follow

● OOP

● SOLID principles

● Namespaces

● Unit Testing

● Domain Driven Design

Unit testing

“A unit test is used to verify a single minimal unit of source code. The purpose of unit testing is

to isolate the smallest testable parts of an API and verify that they function properly in isolation.

API Design for C++, p295; Martin Reddy

Unit testing - Advantages

● Finds problems early

● Forces the programmer to think

● Safety net for refactoring

● Documentation of the system

● Less bugs

Unit testing - Common Myths

● It slows down the development process

● It’s a waste of time

● It is waste when once the project is finished

● But it’s such simple code, why write a test?

Unit testing - What is it not

Unit testing - Basic example

Unit testing - Running tests

Unit testing - Running tests

Unit testing - Structuring the project

Unit testing - Assertions

Unit testing - Assertions

Unit testing - Mock objects, Stubs

Domain Driven Design

to be continued ...