473,804 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

factory design pattern

Hello,
I am building multi platform application and I would like to ask are
there any links which would provide me code with factory design pattern
implementaion in c# for this?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***
Jan 3 '08 #1
6 1611
Hello csharpula,

see www.dofactory.com site, there are samples for the most common patters,
including your one

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
ccHello,
ccI am building multi platform application and I would like to ask are
ccthere any links which would provide me code with factory design
ccpattern
ccimplementaion in c# for this?
ccThanks!
cc*** Sent via Developersdex http://www.developersdex.com ***
cc>
Jan 3 '08 #2

As mentioned, dofactory.com can get you started.

There are free ones there, and at least you'll learn some lingo.

...

If you're a newbie, then the Head First book on Design Patterns is a good
resource.

Check ebay. I periodically check auctions for design patterns....som etimes
I can pick up a book for <$10.
I find design patterns need some time....and the more resources, the
merrier. It sometimes takes different authors giving different examples for
them to click.

Don't limit yourself to c#,...I have some good java design pattern books,
even though I've code about 3 lines of java in the last 5 years.

"csharpula csharp" <cs*******@yaho o.comwrote in message
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
Hello,
I am building multi platform application and I would like to ask are
there any links which would provide me code with factory design pattern
implementaion in c# for this?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***

Jan 3 '08 #3
Hi,

Do a search in google, you will find plenty of articles/examples about it

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"csharpula csharp" <cs*******@yaho o.comwrote in message
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
Hello,
I am building multi platform application and I would like to ask are
there any links which would provide me code with factory design pattern
implementaion in c# for this?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***

Jan 3 '08 #4
http://en.wikipedia.org/wiki/Design_...ter_science%29

Schneider
"csharpula csharp" <cs*******@yaho o.comwrote in message
news:uD******** ******@TK2MSFTN GP04.phx.gbl...
Hello,
I am building multi platform application and I would like to ask are
there any links which would provide me code with factory design pattern
implementaion in c# for this?
Thanks!

*** Sent via Developersdex http://www.developersdex.com ***

Jan 3 '08 #5

Hello,
I looked at the examples but I need somethign really simple. I got
mutual method in few classes (no inheritence) and I need that the main
class will activate the proper function according to file extention of
input. How to implement this? Thank u!
*** Sent via Developersdex http://www.developersdex.com ***
Jan 10 '08 #6
Not real sure what your trying to do but maybe somthing like below:
using System;

using System.Collecti ons.Generic;

using System.Text;

public interface IFactoryExample {

object FactoryMethod() ;

}

public class Example2 : IFactoryExample {

#region IFactoryExample Members

public object FactoryMethod() {

//provide implementation

throw new Exception("The method or operation is not implemented.");

}

#endregion

}

//-------------------

using System;

using System.Collecti ons.Generic;

using System.Text;
public abstract class AbstractClass {

public abstract object FactoryMethod() ;

}

public class Example : AbstractClass {

public override object FactoryMethod() {

//provide implementation

throw new Exception("The method or operation is not implemented.");

}
}


"csharpula csharp" <cs*******@yaho o.comwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>
Hello,
I looked at the examples but I need somethign really simple. I got
mutual method in few classes (no inheritence) and I need that the main
class will activate the proper function according to file extention of
input. How to implement this? Thank u!
*** Sent via Developersdex http://www.developersdex.com ***

Jan 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
6647
by: Medi Montaseri | last post by:
Hi, Given a collection of similar but not exact entities (or products) Toyota, Ford, Buick, etc; I am contemplating using the Abstraction pattern to provide a common interface to these products. So I shall have an Abstract Base called 'Car' implemented by Toyota, Ford, and Buick. Further I'd like to enable to client to say Car *factory;
2
2982
by: Ryan Mitchley | last post by:
Hi all I have code for an object factory, heavily based on an article by Jim Hyslop (although I've made minor modifications). The factory was working fine using g++, but since switching to the Intel compiler it has stopped working. I think the singleton pattern static instance thing may be at the root of the problem, but I'm not sure. I had to add calls to instance() in regCreateFn, which gets the behaviour more in line with what I was...
11
4312
by: FluffyCat | last post by:
In Febraury - April of 2002 I put together in Java examples of all 23 of the classic "Gang Of Four" design patterns for my website. Partly I wanted to get a better understanding of those patterns. They are still online at http://www.fluffycat.com/java/patterns.html Since September 2003 I've mainly been using PHP, and now that PHP 5 is becoming more available I am going to try the same thing I did in Java with PHP.
3
1821
by: Christer | last post by:
Hi all! We're creating an administration for a web application. This includes severeal aspx pages. Our key entity in the web application is "Profile", which can have a certain type. Based on the profile type, the administration pages will have some small changes, such as displaying a few extra tabs, or maybe change the available choices in a dropdown.
2
1586
by: max | last post by:
Hello, I analyze this design pattern for a long time but I do not understand how this pattern work and what the purpose is? (I looked a this site http://www.dofactory.com/Patterns/PatternAbstract.aspx). Could anybody try to explain me in his own words how this pattern work and what the purpose is? thanks in advance
2
1397
by: Chris | last post by:
Hi, I have been stuck trying to come up with a design for days. I am working on a small project regarding barcode and I want to implement a factory design. I am now confused. I decided factory pattern since I am dealing with EAN13, UPCA12 UPC8 etc. Can someone provide a small sample on how to start. I have looked at the factory implementation online but still can't figure it out. Can someone provide a sample jsut to start with.
10
2355
by: sunny | last post by:
Does this following program implement the factory design.if not what are things that i have to change in order to make this following program to be designed to factory design pattern. #include<iostream>
16
2648
by: RSH | last post by:
Hi, I am a fairly seasoned developer and have recently started looking at software design patterns. I am starting with the Abstract Factory Pattern and was wondering if someone could help me understand where I might use this Pattern. I get the general concept but I am having a hard time converting that concept into where I might use that in a real world scenerio for a business application or web development project. I appreciate the...
2
2567
by: Duy Lam | last post by:
Hi everyone, Sorry, I don't know what group to post this problem, I think may be this group is suitable. I'm styduing DAO (Data Access Object) pattern in this link http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html. While I've read about implementing Data Access Objects by Factory Method Pattern (http://java.sun.com/blueprints/corej2eepatterns/Patterns/images09/figure09_07.gif) and Abstract Factory Pattern...
4
5020
by: Pallav singh | last post by:
Hi , when should i select Factory Method / Prototype Design Pattern during my design phase ?? as both look similar to me Thanks in Advance Thanks Pallav
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7613
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.