Skip to content

Instantly share code, notes, and snippets.

View aonomike's full-sized avatar

Mike Aono aonomike

  • Wesbit Technologies Limited
  • Kisumu, Kenya
View GitHub Profile
@aonomike
aonomike / iffyFunctionDemo.js
Created November 5, 2015 06:39
Immediately Invoked Function Expression in Javascript - (function(){..})()
//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);
@aonomike
aonomike / TemplateAndStrategyDesignPatterns.md
Last active November 11, 2015 21:33
Template Design Pattern and a Strategy Design Pattern

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();