Jeremy, OK then, is it even simpler.
> Design: Use interfaces or an abstract base class. Define the methods > that do the data conversion in the interface / abstract base class. > For each dat conversion method, create a concrete class that either > implements the interface or sub-classes the abstract base class. Then, Create a factory method that reads an INI file and creates the appropriate class for the device that you are trying to read. Dennis. ----- Original Message ----- From: "vss" <[EMAIL PROTECTED]> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]> Sent: Wednesday, August 06, 2003 9:26 AM Subject: Re: [DUG]: What is the best way > But Dennis, I might as well write a DLL for each type of device which as > I have mentioned is NOT ideal and NOT practical. The same woudl apply to > writting a package for each device. > > I think I will just uses classes and if there is a device not catered > for, I will just have to release a new EXE. > > BUT I still have one or 2 other ideas to look at too as well tho. > > Jeremy > > -----Original Message----- > From: "Dennis Chuah" <[EMAIL PROTECTED]> > To: Multiple recipients of list delphi <[EMAIL PROTECTED]> > Date: Wed, 6 Aug 2003 08:06:38 +1200 > Subject: Re: [DUG]: What is the best way > > > Message > > Design: Use interfaces or an abstract base class. Define the methods > > that > > do the data conversion in the interface / abstract base class. > > For each dat conversion method, create a concrete class that either > > implements the interface or sub-classes the abstract base class. > > > > Implementation: Use packages. Each class can be in its own package. > > Use > > an INI file setting to determine which package to load. You can export > > a > > method in the package that creates an instance of the class and either > > returns the interface or the abstract base class reference. > > > > ----- Original Message ----- > > From: Jeremy Coulter > > To: Multiple recipients of list delphi > > Sent: Tuesday, August 05, 2003 10:54 PM > > Subject: [DUG]: What is the best way > > > > > > Hi All. > > I have got an app. that gets data from devices via the comport. > > 60% if not more of the data from these devices is similar or easy to > > deal > > with, like dates and times, but other info can be specific to a device, > > and > > i have to normalize it into a format that I want. > > > > In times gone by, about 6-7 years ago, if not more, when I first wrote > > this > > app., I used DLL's and depending onn teh devide you specified in an INI > > file > > it used that DLL, which I think from memory was done via the setup, so > > there > > was only one DLL. > > BUT this was really not a good idea, as it was hard to debug and just > > overall never practical. > > > > I have thought that I could use classes this time round, once again > > specifying the device type in an INI file, and then based onthat it > > would > > know hat class to use. > > But is this the best way either? I mean, if I find a device that has > > not got > > a class for it already, then its a new EXE release. > > > > I guess what woud be idea would be if I could load some specific > > functions > > up at runtime, and then access them then it would only ever be a txt > > file or > > whatever that I would need to distribute. > > I thought something like Delphi WebScript, but I need to get results > > back to > > go into a DB. > > > > Has anyone got any Ideas? Would Classes be the best? or is there > > something > > else I can look at? > > > > Cheers, > > > > Jeremy Coulter > > > > > > ----------------------------------------------------------------------- > > - > > All email scanned with Nortons Antivirus 2003 > > ----------------------------------------------------------------------- > > - > > ----------------------------------------------------------------------- > > ---- > > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > > Website: http://www.delphi.org.nz > > To UnSub, send email to: [EMAIL PROTECTED] > > with body of "unsubscribe delphi" > > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > > -------------------------------------------------------------------------- - > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ > --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
