Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

UML and perl

by drfrog (Deacon)
on Dec 24, 2003 at 01:15 UTC ( [id://316767]=perlquestion: print w/replies, xml ) Need Help??

drfrog has asked for the wisdom of the Perl Monks concerning the following question:

Hello!

I've been trying to figure out a way to use UML to describe a perl based project and then spit out modules, this is possible through ummf which is available at sourceforge.net

i know of a couple of modules that allow for reverse engineering of perl modules into uml, which seems fairly cool

i am fairly new to all this, but it really intrigues me, if someone could give me some helpful starters, book recommendations , documents, and of course example code :) id be ever so grateful

does anyone think this is a good practice to use this? it seems like you could take a specification's UML diagrams and spit out code pretty fast. Any thoughts on this?

we can pick apart the idea of using uml over makemaker and h2xs as well!!!

I await your wisdom

Replies are listed 'Best First'.
Re: UML and perl
by perrin (Chancellor) on Dec 24, 2003 at 05:42 UTC
    There have been some attempts to do this sort of thing, either with Dia, or with SQL Fairy using an open XML format. The tricky thing here is that first you need to have a good graphical UML tool that can generate something that your code generator can work with.

    This would not have much to do with MakeMaker or h2xs though. The former is an installation system and the latter is a helper for integrating C code. Some people do suggest using h2xs to create stubs for pure perl modules, but the results are not very good (bizarre file layout).

      Ive used both MakeMaker and h2xs to provide me with stub perl modules!

      and i think UML could add a level of structure to this endeavour

      Does anyone know how uml is structured via xml? ive been looking for documentation on that as well

        The UML --> XML thing is called XMI. You can read about attempts to support it in SQL Fairy at the link I specified.

        I still think you are confused about MakeMaker. it is an installation system. It does not generate any code except makefiles. h2xs works for making stubs of very simple modules, but is broken for anything involving multiple package namespaces because of the strange file layout it generates.

Re: UML and perl
by pg (Canon) on Dec 24, 2003 at 02:04 UTC

    I think we have a bit misunderstanding of what UML is for:

    • UML has nothing to do with any particular programming language.
    • Take one step further, and more importantly, UML is not a development tool, but rather a way to describe the system and the requirements.
    • However through certain tools, it is possible to generate the skeleton of your system base on the description of your system expressed in UML.

    It is definitely a good idea to describe your system and user requirement in UML, and that is true across prorgamming languages.

    To me, UML is the tool to reduce miscommunication among people.

      UML class and sequence diagrams can be directly translated to any language supplying the types exist in that language which you point out (indirectly). That seems to be his goal and what he's asking for advice on.. if it's smart or good or whatever... not if by using UML, will he avoid writing any code.

      Play that funky music white boy..
      I agree!

      the point i am making is that ramping up to development from the pre-production stage is possible from properly laid out uml diagrams

      i find problems in uml's how-to's in describing perl objects.

      I guess i could reverse engineer some perl objects to see how it should look!

      Again , i do think UML's main purpose is to help in pre-production, but i also think it can provide a useful linkage to production, helping a developer set up the perl modules for a project, wasting less time in setting up for the development stage
        It also helps in post and in production systems. When a system breaks or needs to be maintained, jumping into someone's code isn't easy. With various UML diagrams, it's really easy to at least know what relates to what.

        Play that funky music white boy..
Re: UML and perl
by Anonymous Monk on Dec 24, 2003 at 22:51 UTC
    Possibly drfrog means MethodMaker not MakeMaker. UML might be a bit abstract to generate perl code from. You would have to provide lots of hints. Write the Use Cases and auto generate the code. Ahhh the dream / mirage of CASE.
      All this has made me realize I need to explain this a bit better! its not really about UML, its about Developing in Process

      I hope that meditation make more sense!

      I think what UML has done is opened up this ideal to me, h2xs Make::Maker, and UML all have their constraints and uses, but i think this meditation goes into the why of it all

      I think this shold explain where i want to go with all this sooner than later i hope to have ummf figured out a little better and i will post some example code

      the only thing i am having problems with is finding uml diagrams to xmi converters anyone know of anything?

      Oh and some pointers/explains on this CASE stuff, it sounds interesting

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://316767]
Approved by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-03-29 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found