[Ml-yokadi] k_edit

Aurélien Gâteau aurelien.gateau at free.fr
Sun Apr 25 11:11:28 CEST 2010


On 25/04/2010 09:26,oo Sébastien Renard wrote:
> Le mardi 20 avril 2010 17:40:25, Aurélien Gâteau a écrit :
>>> Well, we already have YokadiCmd that can do that. Like we do for some
>>> shared variables (prompt, history...).
>>
>> Putting them into YokadiCmd would force us to instantiate a YokadiCmd in
>> unit-tests, which I would like to avoid.
> 
> Why ?

Because TaskCmd needs the lastTaskId, pFilters and kFilter vars to work
correctly, so they would be needed in unit-tests as well.

>> Thinking a bit more about the idea of having BugCmd inherit from
>> TaskCmd, I am wondering how the Cmd class would handle this: right now
>> YokadiCmd inherits from TaskCmd, but it would have to also inherit from
>> BugCmd, which means TaskCmd commands would be included twice...
> 
> Right. So, we can only inherit from BugCmd in YokadiCmd (which is weird I 
> admit) or create a super class (YokadiShell) as you proposed. The second 
> option is the best one.

Yes, it's a bit weird. This is because YokadiCmd abuses the notion of
inheritance: we can't say that YokadiCmd IsA TaskCmd (or any other *Cmd
class). It simply inherits from them to aggregate all the do_* methods
together.

Aurélien


More information about the Ml-yokadi mailing list