Re: [shoes] Shoes pluggable framework
- Eric Watson
- 2012-01-13 @ 21:06
On Jan 12, 2012, at 10:23 AM, Peter Fitzgibbons wrote:
> I'd like to hear thoughts and conversation around the following :
> • Every Shoes Class has a Framework base-class : Shoes::Animation <
Rather than using inheritance, I would consider using composition, so that
each Shoes::* object has an instance variable that is framework specific,
@framework_object = framework.const_get(:Animation).new
so that when you create a new Shoes object, it comes with an appropriate
1.9.2p290 :024 > s = Shoes::Animation.new
but you can specify the framework:
bs = Shoes::Animation.new(BrownShoes)
And it would be better designed than this ;) perhaps using a config style,
like I saw in RuGUI:
Shoes.config[:framework] = :brown_shoes
> • Each Shoes "GUI" lives "on its own", implementing the ::Framework classes
> • For now, the frameworks will be in files
./lib/shoes-<framework-name>, a sibling of ./lib/shoes. IE:
> • Packaging and Gemification can happen later. For now all frameworks
will be in the shoes source (no different than RedShoes)
> • An Rspec "Framework Suite" of shared_expectations will be coded that
defines the "interface requirement" of any Framework Implementation
These all sound reasonable to me.
> • The Shoes Rspec suite will mock framework and test only the
"frontend". This represents the "pure-Ruby" part of RedShoes +++.
I think the ShoesSpec suite can test all the way down to the Framework
calls (using a MockShoes framework). It can verify that the proper
messages are being sent to the framework.
I would say that this represents "the future pure-Ruby part of RedShoes"
since right now in RedShoes, lots of that interface is written in C.
> Thanks for your feedback and ideas.
Thanks to you for pushing us onward!