gaurav bagga wrote:
Hi all,
Thanks all for replies, it seems that UML does holds a place in agile
develpopment, its not as I thought.
From some of the replies it seems that UML->Code and Code->UML thing for
ruby is a plus for an agile team(if there is a toll like that).
One thing that struck my mind was people say they use metaprogramming
inplace of UML. I'll really appreciate if anyone can give an example how
that can be used. Is it as terse as UML for a team??
This is in C++ (from the book "C++ Template Metaprogramming" - Addison Wesley), but I think this is a good example of what you are asking for:
// Current Event Next Action
// State State
// +---------+------------+---------+-----------------------+
row < Stopped , play , Playing , &fsm::start_playback >,
row < Stopped , open_close , Open , &fsm::open_drawer >,
// +---------+------------+---------+-----------------------+
row < Paused , play , Playing , &fsm::resume_playback >,
row < Paused , stop , Stopped , &fsm::stop_playback >,
row < Paused , open_close , Open , &fsm::stop_and_open >,
// +---------+------------+---------+-----------------------+
It's a state definition with transitions presented as a table for a media-player.
E.g. if you send 'play' when its 'Paused', the state changes to 'Playing' and it calls the function 'resume_playback'.
It looks like putting the specification or UML into the code.
If anyone has an idea how to do this and similar tricks (from the book) in Ruby, it would be really cool ... In any case, I would expect the implementation to be trivial in Ruby compared to C++.
Regards,
Zatoichi
···
----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e