intro to software architecture

19
Software Architecture Ethode University

Upload: jason-ables

Post on 27-Jul-2015

59 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Intro To Software Architecture

Software ArchitectureEthode University

Page 2: Intro To Software Architecture

“I hear and I forget. I see and I remember. I do and I understand.”

- Confucius

Page 3: Intro To Software Architecture

The Big 3Follow these three simple rules for clean code.

Page 4: Intro To Software Architecture

Stay DRYDon’t Repeat Yourself

Page 5: Intro To Software Architecture
Page 6: Intro To Software Architecture

Keep It Super SimpleComplexity is expensive. Less complexity = less bugs.

Less complexity = easier to read and understand.

Do the simplest thing that could possibly work.

Page 7: Intro To Software Architecture

YAGNITrust in your ability to solve problems as they arise. Don't build

something now that you _might_ need in the future. If you don't need it now, or it's not in the requirements, do not build it.

Page 8: Intro To Software Architecture

Good Rules of Thumb

- Keep your class, variable and method names verbose – avoid uncommon abbreviations

- Always think: “What am I actually doing?” – design your API the way you would want to use it. Tell your app to do something, don’t ask.

- Keep flow paths to a minimum: remove unnecessary else statements whenever possible

- Reduce complexity by keeping your indentations to one level ideally – forces you to extract behavior into more modular code

Page 9: Intro To Software Architecture

The SOLID Principles

Page 10: Intro To Software Architecture

S: Single Responsibility

Separation of concerns

- Routing- Validation- Filtering- Logging- Formatting

- Mapping- Notifications- Parsing- Object Creation- Rendering- Querying

Page 11: Intro To Software Architecture
Page 12: Intro To Software Architecture

O: Open/Close Principle

Don’t add a basement to a finished house.

Page 13: Intro To Software Architecture

L: Liskov Substitution Principle

In other words: Design To An Interface. Whopper and BigMac both implement the HamburgerInterface

Page 14: Intro To Software Architecture

I: Interface Segregation PrincipleKeep your interfaces small. By following this principle, you

will implicitly follow the Open/Closed Principle, win-win

Classes that implement interfaces should not be forced to implement methods that they do not use. Violation of this principle is a red flag that your interface is too big and should be broken down into smaller interfaces

Page 15: Intro To Software Architecture

D: Dependency Inversion Principle

Communication between high level and low-level classes should be done through abstraction. In other words, reference interfaces and not concrete classes

- File System - Database - 3rd Party Libraries - Mailing - Web Services - Configuration

Page 16: Intro To Software Architecture
Page 17: Intro To Software Architecture

Onion Architecture

Page 18: Intro To Software Architecture

Pattern RecognitionLearning different frameworks helps you recognize common architecture

patterns and which ideas consistently emerge as best practices.

Page 19: Intro To Software Architecture

Most problems can be solved with another layer of abstraction.