[SerialICE] [RFC] Object Oriented Device Model?
Peter Stuge
peter at stuge.se
Sat Nov 21 20:32:33 CET 2009
Stefan Reinauer wrote:
> Since we seem to have additional filter rules for every board, BIOS,
> SuperIO and chipset we support, I gave it a shot and prototyped a small
> "object oriented device model" for our filters. So each filter could run
> through all registered components for a board and run the filters suited
> for that hardware (and only those).
How does it work now? There's a single filter with lots of different
rules for each component? I think this is a good improvement then!
> function superio_smsc:new(o)
> o = o or { } -- create object if user does not provide one
> setmetatable(o, self)
> self.__index = self
> return o
> end
I think initializers should be generic and out of the way, if
possible. It would be nice to avoid having fifteen new() that all
look exactly the same.
//Peter
More information about the SerialICE
mailing list