Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Facade Pattern

The Facade Pattern

My talk on the facade pattern

Armen Vartan

March 19, 2015
Tweet

More Decks by Armen Vartan

Other Decks in Education

Transcript

  1. What Is Software Design? • Software design is the process

    in which you define the requirements and plan the flow of information for your software. • It’s really more than that, but we’re going to think of it this way for now. • It deals with higher level concepts — more about interfaces than implementations
  2. Design Is A Wicked Problem • A ‘wicked’ problem is

    one that takes solving it to come up with a better solution. • You won’t come up with the best design for something, until you’ve made a worse version of it.
  3. Design Is A Sloppy Process • Regardless of your end

    product. • You will make a lot of ‘wrong’ turns and hit a lot of dead ends. • You will feel like you have no idea what you’re doing.
  4. There Will Be Tradeoffs • Everything takes time or space.

    • Your time is limited -> deadlines. • Every language has different strengths and weaknesses • Certain features may be more important • How you design interactions can either give or take away flexibility for your code to adapt to growing or changing needs.
  5. The Facade Pattern • The facade pattern puts a layer

    between your program and outside interactions. • Creates a consistent interface for your modules to interact with
  6. What Does This Do For Me? • You deal with

    all of your error handling of bad inputs in one place. • You can give yourself consistently formatted data. • You don’t have to worry about what you’re getting throughout the whole program, just in the facade.
  7. Advantages • Your code will be more readable and easier

    to understand. • Less chance of missing error checks, since you’re cleaning the data at its point of entry. • When you’re writing a routine, you can worry about coding good solutions, and not tripping over your own feet.