• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Design patterns  - Abstract Factory Pattern
 

Design patterns - Abstract Factory Pattern

on

  • 1,583 views

This presentation is part of the Design Pattern Series. Presentation explains the use of Abstract Factory Pattern comparing it against a real life situation and then showcasing the Java implementation ...

This presentation is part of the Design Pattern Series. Presentation explains the use of Abstract Factory Pattern comparing it against a real life situation and then showcasing the Java implementation of the same.

Statistics

Views

Total Views
1,583
Views on SlideShare
1,555
Embed Views
28

Actions

Likes
0
Downloads
41
Comments
0

4 Embeds 28

http://www.ancitconsulting.com 20
http://ancitconsulting.com 4
http://www.linkedin.com 3
https://www.linkedin.com 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Design patterns  - Abstract Factory Pattern Design patterns - Abstract Factory Pattern Presentation Transcript

    • QmPe initiativeABSTRACT FACTORY PATTERN explained ! Prepared by Annamalai C Copyright 2006-2011
    • Abstract Factory Pattern in Real LifeAbstract Factory Pattern is similar to Sub Contracting in real world.Basically delegating the creation of Objects to expert Factories-----------------------------------Orders in a restaurant are received by a Kitchen.Then are assigned to Special Chefs likeChinese, Indian, Continental.Abstract Factory Pattern is a Creational Pattern.Similar to Factory Pattern it is Object Creation without exposing “HOW” ? Copyright 2006-2011
    • Abstract Factory Pattern in Java Copyright 2006-2011
    • Real Life vs Java Object Factory Kitchen Copyright 2006-2011
    • Real Life vs Java Object Copyright 2006-2011
    • How Factory Pattern works in Real Life ? 1 Orders a Dish from Menu Receives the Order 2 Creates the Dish 3 Outsources to Chef 4 Delivers the Dish Copyright 2006-2011
    • How Factory Pattern works in Java ? public Food getFood(String name) { if (name.equals("Dosa")) { IndianFactory factory = new IndianFactory(); 1 return factory.getFood(name); } else if (name.equals("Noodles")) { ChineseFactory factory = new ChineseFactory(); return factory.getFood(name); }KitchenFactory factory = new KitchenFactory(); Return null;}Food dosa = factory.getFood("Dosa"); 2dosa.print(); Create food from Respective Factory ClassFood noodles = factory.getFood("Noodles");noodles.print(); 3 Food 4 Dosa Noodles Copyright 2006-2011
    • THANK YOU Please visitwww.eclipseinclips.com | www.ancitconsulting.com Write to us on info@ancitconsulting.com QmPe initiative Copyright 2006-2011