Factory pattern sample added

Signed-off-by: Vishnu <vishnu.garg@shephertz.co.in>