GithubHelp home page GithubHelp logo

codesprinter / design-patterns-in-apex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bdjohnson72/design-patterns-in-apex

0.0 1.0 0.0 668 KB

Classic Gang of Four design patterns in the Salesforce Apex programming language

License: Creative Commons Zero v1.0 Universal

JavaScript 2.50% Apex 95.97% HTML 1.53%

design-patterns-in-apex's Introduction

Design Patterns In The Apex Programming Language

CI Workflow

recipes-logo

Few things have helped me more in my career than understanding how you use the Object Oriented Features of Apex to write code that is flexible, testable and maintainable. I have done quite a few YouTube videos on this topic and have a lot more to do. I was not happy with my previous Repo and its organization. This is an attempt of my part to give back to the community with repo that offers implementations of all the class Gang of Four patterns in Apex. I grant you that my implementations will often be trivial and contrived. But I hope that helps make the underlying ideas easy to understand.

If I have also published a video about the pattern I have added a link to in the heading.

Table of Contents

Creational Patterns

Design patterns that are concerned with the creation of objects

  • One of my every day go to patterns. Code is based on Head First Design Patterns
  • UML diagram

-Watch on YouTube

This can be a bit more involved but is also the ultimate in closed for modification but open for extension. By making our factory reflective we never need to update it when we add new concrete types.

  • Unique to Apex and Salesforce. Refactor the simple factory pattern with custom metadata. Wow your colleagues with the Type class. One of my favorite Apex party tricks.

-Watch on YouTube

Another implementation using the pizza example from Head First Design Patterns. What do we do if we want our Pizza Store to access different factories?

-Watch on YouTube

An easy pattern to understand and always useful for keeping your governer limits under control

Behavioral Design Patterns

These patterns are all about the communication between objects. How can objects cooperate to perform tasks.

-Watch on YouTube

When one object changes state we want to notify all the depenents. But we want to publisher and subscribers to be loosely coupled.

Read All About It

Nothing in this repo would be possible without the books below. And most of the implementations will be based on ones found in these books. If they are not on your shelf they should be.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.