Skip to content

Instantly share code, notes, and snippets.

View jasper-lyons's full-sized avatar
💭
Full time educator, part time developer

Jasper Lyons jasper-lyons

💭
Full time educator, part time developer
View GitHub Profile
@jasper-lyons
jasper-lyons / Builder.py
Created January 22, 2014 13:26
Creational Design Patterns in Python: The Builder
#### The product to contruct ####
class Product(object):
def __init__(self, extra):
self.extra = extra
def do_somthing(self):
print "Doing Something{0}!".format(self.extra)
#### The Builder for a type of product ####
@jasper-lyons
jasper-lyons / AbstractFactory.py
Last active January 4, 2016 02:49
Creational Design Patterns in Python: Abstract Factory
########## The Factory's base class #########
class AbstractFactory(object):
def create_product(self, **args):
raise NotImplementedError("Requires derived factory class for implementation.")
######### The class of the object that needs creating ###########
class Product(object):
@jasper-lyons
jasper-lyons / JPlayer.java
Created December 21, 2011 01:19
Java media player, should be a package to allow easy creation of a java meia player and a player itself.
/*
* The First Class
*
/*