Hi All.
Over the weekend I have been investigating Scripting tools that run in
Delphi.
I had already used Delphi WebScript in another project, so I kinda new
about it, but I also looked at the TMS Scripting Studio.
I was still concerned that I would need to send a new EXE or a new DLL
out if there was a bug in the Factory Methods I was going to use after
Dennis suggested them, and I wondered just what I could do with a
scripting Lang.
I ended up back at DWS, and the one MAIN thing I needed to do was pass
values to the script and read them back out, esp. record structures.
I was pleasently surprised to see that you CAN do this with DWS (in a
way).
I have basically now got a structure that reads the Script out of a DB
depending on what device it is, and puts it into the DWS Scripting comp.
and I can pass it variables and get variables back, just as if I was
using a Factory.
The advantage to this IS, I can send a bug fix with NO recompiling
needed, so EXE versions stay the same, and I can store the script into a
DB and call up the script at any time, and even get someone on site to
update the script if needed.
Generally there is only one device per site, but we might get some data
from differenet sites that need to be proccesed by us for some reason,
so this way, we can switch devices nice and easily etc. etc. etc.

SoI am happy to have a good simple solution that I think will work well.
Now I just have to create 10-15 of these scripts :-)

Jeremy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dennis Chuah
Sent: Wednesday, 6 August 2003 12:42
To: Multiple recipients of list delphi
Subject: Re: [DUG]: What is the best way



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/

---------------------------------------------------------------------------
    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/

Reply via email to