[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [OT:usage of uml]

David Vallner

10/20/2006 11:54:00 AM

gaurav bagga wrote:
> I have just started to learn about Agile development and was told that in
> Agile very less focus is given to documentation and usage of UML related
> things is very less. Is it that its not used at all by most Agile
> developers
> and most of the focus is on Test Driven Development. If code generation is
> accompanied along with the tool being used for UML do people in agile go
> for
> UML usage. This is the case I have seen in Java world using UML
> extensively.
> As in Agile, time is a factor they dont get into that much details of UML.
> So I was wondering how to gauge how much important UML is to Agile world.
>

There are more uses to UML than code generation (which I haven't seen
used yet actually.)

For certain problems, it's useful to have dedicated analysts or
high-level designers (can as well be one person) if the problem domain
being modelled is one the developer team has little expertise in - if
this person isn't a developer, UML is a standardised way for him to
communicate his work to the team members that are. Also if the model has
to be represented / manipulated using multiple languages (DDL for a
RDBMS, and multiple clients on that database in different programming
language), it might make sense to use UML as a lingua franca for the
reference representation of the model - of course, if all developers
have basic skill in one of those languages, you might use the model
implementation in it for this purpose.

Another reason I see behind UML-bashing by the agile crowd is that they
are people that don't have the brain arrangement (this I don't mean as
an offensive statement) to process the diagrams as efficiently as they
would see the actual code. For people with a degree of visually-oriented
thinking, a UML diagram can be a good tool to organise your thoughts on
a problem. I personally find (high-level) activity diagrams or sequence
diagrams easier to comprehend than code across three files.

For purposes of maintainability, UML is a more terse documentation
artefact for some views of a system than source code documentation.

On the whole, I'd say UML still is a valid tool for agile development.
You're likely to use only high-level variants - UML that is on a level
detailed enough to be used for code generation wouldn't be created up
front, maybe as a documentation artefact if that is required. It's also
still useful as a means of communicating a notion if you find you can
create and comprehend it as fast as or faster than other methods - a
unit test replacing a nontrivial sequence diagram might be much more
verbose, for example, if of more value on its own

David Vallner

3 Answers

Joel VanderWerf

10/20/2006 10:16:00 PM

0

David Vallner wrote:

> For purposes of maintainability, UML is a more terse documentation
> artefact for some views of a system than source code documentation.

It would be interesting if it were possible to generate UML from ruby
source and/or execution traces. Like RDoc's use of graphviz/dot to
generate class hierarchy diagrams, but more comprehensive. Or like
ruby-prof's call graph generation.

That would be useful for communication and understanding, though code ->
uml is opposite to the more usual uml -> code direction.

I prefer to use metaprogramming in ruby rather than UML to express high
level concepts in code, but as you say some kinds of communication need
boxes and arrows....

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Its Me

10/21/2006 2:49:00 AM

0


"Joel VanderWerf" <vjoel@path.berkeley.edu> wrote in message

> It would be interesting if it were possible to generate UML from ruby
> source

Some of this would be simplified if the various flavors of #attr_accessor,
#trait etc. actually kept around a simple representation of the declarations
themselves, rather than just generate corresponding method code.

> and/or execution traces.

Wouldn't this be hard without a hook into object creation e.g. via some
dependency injection mechanism?

> I prefer to use metaprogramming in ruby rather than UML to express high
> level concepts in code,

+1 . Metaprogramming in ruby beats any UML diagramming because you are
starting off with executable code, and can so easily craft a DSL suited to
just your need (rather than have to work with the universal solution claimed
by UML).



cybernet

10/22/2006 8:31:00 PM

0

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.interi...