[SerialICE] [RFC] Object Oriented Device Model?

Stefan Reinauer stepan at coresystems.de
Sun Nov 22 01:18:59 CET 2009


Peter Stuge wrote:
> 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!
>
>   
Yes.. The same filter function right now catches the BMC calls on the
Dell 1850 and the SuperIO serial port configuration on one of the two
Winbond SuperIO chips of the Kontron 986LCD-M.... This works for 5
boards, but maybe not even that when people start using SerialICE more
intensely.

>> 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.
>   
Yes, absolutely. What about this... (see attachment)

There's also a lua class library and some more or less complex
implementations mentioned at
http://lua-users.org/wiki/ObjectOrientedProgramming.

Stefan
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: playground.lua
URL: <http://serialice.com/pipermail/serialice/attachments/20091122/392e3c5a/attachment.bat>


More information about the SerialICE mailing list