Text or Number
Scott Penrose
scottp at dd.com.au
Sun Mar 28 18:16:39 CST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 29/03/2004, at 8:19 AM, Joshua Goodall wrote:
> Scott, this motivates yet another way: make your controlling class
> abstract, and then require the user to explictly request a subclass
> that implements the actual desired behaviour. Since it's unlikely
> that someone will be working in both the character and the acq/control
> paradigms, they can request a concrete class that fits their
> requirements.
Maybe. But only if it is slow.
> You can also hide platform-specific implementations behind such a
> factory method, giving the illusion of portability.
It already does this. You just do this...
my $pp = Device::ParallelPort->new();
now, if you don't specify a driver (and they look like dbi - eg:
parport:0) then it uses auto.
Auto, looks at the Operating System and some files to see if you are on
Linux with parport, else linux root, else windows, else HELP I DONT
KNOW. As I implement new drivers, I will update auto to deal with the
automatically. (I even been trying to think of a way of getting auto to
find all drivers installed and ask each one in turn - like that of an
Apache module handling an event).
use Device::ParallelPort;
my $pp = Device::ParallelPort->new();
$pp->set_bit(0,1);
works with no code change on Linux (parport and direct io) and Windows
already - and soon to be Free BSD.
Scott
- --
Scott Penrose
VP in charge of Pancakes
http://linux.dd.com.au/
scottp at dd.com.au
Dismaimer: If you receive this email in error - please eat it
immediately to prevent it from falling into the wrong hands.
Please do not send me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQFAZ2rnDCFCcmAm26YRAvySAJoCAZjSRFHfoToqUM2eDPpHGiBerwCgkfar
XgImlfb7g3pROI7NYrTenyw=
=wiKB
-----END PGP SIGNATURE-----
More information about the Melbourne-pm
mailing list