Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Aono aonomike

View GitHub Profile
@aonomike
aonomike / TemplateAndStrategyDesignPatterns.md
Last active Nov 11, 2015
Template Design Pattern and a Strategy Design Pattern
View TemplateAndStrategyDesignPatterns.md

Template Design Pattern

Works with dependency inversion, which states that low level objects should not depend on high level objects Mainly used when objects follow a given sequence to perfom a task but the tasks are implemented differently in every object

//the abstract class, note that the manufacture function calls the abstract methods
public abstract class GeneralManufacturingProcess {
 public abstract void assembly();
 public abstract void test();
 public abstract void pack();
@aonomike
aonomike / iffyFunctionDemo.js
Created Nov 5, 2015
Immediately Invoked Function Expression in Javascript - (function(){..})()
View iffyFunctionDemo.js
//Test Function showing the use of iffe (Immediately Invoked Function Expression ) in javascript .
//The function executes immediately after it’s created.
var myVariable;
(
function(myParameter){
alert(myParameter)
}
)(myVariable);
You can’t perform that action at this time.