TechSapphire Tuesday, 2024-03-19, 11:10 AM
Site menu
Login form
News
Play Games
  • Deep Freeze
  • Ice Slide
  • Gyroball
  • Fat Fish
  • Bush Royal Rampage
  • —Factory design pattern

    —Factory design pattern is creational design pattern, and came into play when their was requirement of fixing 2 major issues:
    1. —Avoiding using new keyword again and again in code.
    2. —Avoid client to know internal class hierarchy, means  client side implementation should not include internal knowledge of business layer.
    In the example we have divided application into 4 projects:
    1. Interface project
    2. Class project where classes are implementing interface
    3. Static class project in which static method is returning reference of interface created in first project
    4. Windows application project (End Client)
     
    Below is solution diagram.
     
     
    Factory design pattern first help you to remove client application direct link to operational classes. Instead intermediate class is used to provide reference of interface pointing to requested class. With this first client is not supposed to remember different classes and condition required to call them. Also using of new keyword is avoided.
     
     
     
    Categories
    Programming [27]
    Tips for programming
    Security [2]
    Security Tips
    Google [1]
    Use google faster then ever you use
    Project [14]
    HTML [2]
    Electronics [0]
    Data Structure [0]
    Database [16]
    SQL SERVER
    SSRS [1]
    Sql Server Reporting Services
    Copyright MyCorp © 2024