From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4c17e6ae73bd8c51 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed1.swip.net!not-for-mail Message-ID: <4C800A2C.1060800@nowhere.com> Date: Thu, 02 Sep 2010 22:33:48 +0200 From: nobody User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: sv, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada and UML References: <4C7D7229.3000501@nowhere.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Organization: A Customer of Tele2 NNTP-Posting-Host: 212.151.10.126 X-Trace: 1283459690 anchorman-read.tele2.net 16871 212.151.10.126:1059 X-Complaints-To: abuse@swip.net Xref: g2news1.google.com comp.lang.ada:13919 Date: 2010-09-02T22:33:48+02:00 List-Id: Yannick Duchêne (Hibou57) wrote: > Le Tue, 31 Aug 2010 23:20:41 +0200, nobody a écrit: > > I do not really believe in automatic source generation from UML Neither do I because - UML is too large, writing a model translator to cover it would take longer than writing the system you want to generate. - UML makes it possible to create models with internal conflicts. > Or else, may be these systems use > something to tell “for This, use That”. As Simon Wright commented. The thing we use is Executeable UML (xtUML). I use bridgepoint. For C++ generation we use a model compiler from Mentor for Ada we have built one from scratch. Regarding the for this use that, use it happens. Often. But not always. The model compiler is in many cases quite as capable as I to analyze the model and decide if instances of one class should be allocated dynamically or created once and for all in an array. If traditional pointers or some other mechanism should be used for relations and so on. > Just think that in Ada, you may > have for example at least, where polymorphism is required, two ways to > do (when feasible, sometime only one will applies) : static (via > generics) and dynamic (via tagged or interface) polymorphism. How can a > system know it should use this or that ? This requires a human > analysis, to say “well, this can be statically known, so let's use > static polymorphism” or else the opposite (just an example). There are of cource such examples. But remember that when doing the translation from model into code you have the whole model of your system available in a databas and can can look at things from a much better perspective than when you are coding a single file. An easy to understand example is relations. If you draw a simple line in the class model you state that there is a relation. But the model compiler can look at every single line of code in your system to see if you use it (navigate) or not. If it sees that you never use it, it wont have to generate the code to maintain it and if it finds you only navigate one direction it can add the code neded for it to be one way only. (Now many hard core coders will feel lost, what does he mean one way only, arn't they all? No in xtUML they are always bidirectional, composite, aggregate and navigability as in UML does not exist). > Your point makes me think about the so called “Executable UML”. > Unfortunately, I do not know anything about it. I am just pretty sure > this cannot be automated. I think it can. We are in the process of completing a pretty large system. Its got ~650 classes of which probably around 200 has state machines. Generated system is > 3000 ada packages. > If you wan to tell more... just do :) Sorry, not allowed to give details. Call Mentor, ask for when John Wolfe or Cortland Starret can be in your area, you want to have a look at their system modelling products. Simon mentioned distribution. We use that. In our system we can mark classes and services as distributed. Then the model compiler generates definition files for the broker and in the classes it generates all the interface code needed to distribute things when it is updated. So, do I have anything to complain about? Yes - Price of the tool. - Your first project will fail. Try to combine this knowledge with the pricecs when you seek finansing. - Availability of model compilers - Constantly having to defend the method - Performance of the model compiler. Coming from a world where a recompile takes perhaps as long as 15 seconds entering a world where regeneration/recompilation takes three hours is sometimes (read always) hard. The generated code is probably faster than anything I could have written myself. Regarding SPARK I know just about nothing. I know there has been work on modifying the Ada compiler to produce spark code. Do not know how far that has gone or what efforts need to be done. There has also been work on generating VHDL. Just think about it. Model a system and end up with hardware specific for your problem. One strange thing the non believers tend to bring up is that software development needs to be fun. My comment is that I have now done this for six years. It has been the most interesting years of my twenty as a professional software developer. The productivity you can reach is beyond anything I had imagined before.