Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Object

do i realy need a factory pattern.

 
Jump to:  
 
Vinay Bhushan
PostPosted: Tue Jul 22, 2008 10:38 am    Post subject: do i realy need a factory pattern.
       
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace test
{

class Program
{

static void Main(string[] args)
{

baseObjectType newvalue = new baseObjectType();

newvalue =
BaseObjectTypeDAO.setvalue<baseObjectType>(newvalue);

Console.WriteLine(newvalue.X.ToString());


PayObjectType newb = new PayObjectType();

newb.X = 101;

newb.Y = 101;

//returns a payobject on a for a given id
newb = BaseObjectTypeDAO.setvalue<PayObjectType>(newb);

Console.WriteLine(newb.X.ToString());

Console.WriteLine(newb.Y.ToString());


//return a recipt object for a given id
ReceiptObjectType newc = new ReceiptObjectType();

newc.X = 102;

newc.Z = 102;

newc =
BaseObjectTypeDAO.setvalue<ReceiptObjectType>(newc);

Console.WriteLine(newc.X.ToString());

Console.WriteLine(newc.Z.ToString());

Console.Read();

}

}

//no workflow associated
class baseObjectType
{

int x;

public int X
{

get { return x; }

set { x = value; }

}


}

//a workflow is associated to move from checked, cleared and
pending.
class PayObjectType : baseObjectType
{

int y;

public int Y
{

get { return y; }

set { y = value; }

}



}

//a workflow is associated with new and cleared state changes.
class ReceiptObjectType : baseObjectType
{

int z;

public int Z
{

get { return z; }

set { z = value; }

}

}

class BaseObjectTypeDAO
{


public static T setvalue<T>(T value)
{

baseObjectType A = value as baseObjectType;


A.X = 10;

return value;


}




}

}
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

texas holdem drzwi dachówki salon kosmetyczny Decoupage