A more advanced hello world program

This tutorial shows you another, more complicated methode to program a hello world program with Astade. To make it clear in advance: This is not a very elegant way of doing a hello world application. This is unnecessary complicate and this for only one reason, to show you the different diagrams and possibilities of Astade. Thease are really helpful, if you have bigger and more complicate programs to develop than a hello world really is.:-P

Always the first thing: the use case diagram

It is a good idea, to start every project with a use case diagram. You have a rough idea, what your project shall bring you? fine, draw it down. It's not your own project, but you develop for someone else? Again, draw it down to proove, if you all have the same goal.

Create a new component “Hello2”. Select “Add use case diagramms” and add a use case diagram to the component.

Here is the use case diagram for this hello world. The answere to the question: “where is the use?” Start AstadeDraw and do this diagram to get use to the diagram editor. Give it a descriptive name. I've chosen “thingsToLearn.ucm” as name for the use cas diagram. The extention ”.ucm” is important, because the Astade Tree uses this extention to determine the correct editor for that file. Because you want Astade to open this file with AstadeDraw, select a filname with the ”.ucm” extention.

Create a package for the classes

Next thing: create a pckage for the classes an create two classes inside this package.
One class is called “helloAppl” and the second is called “HelloWork”.
In addition to that, go to the “Hello2” Component and select “set as active component”, because we are going to work on the component “Hello2” now and not longer an the component “Hello1”.
The component “Hello2” will get the “green dot” now, to indicate, that the active component has changed.

Add the classes to the component

In one model you have lots of components and lots of classes. Astade muts now somehow, which classes belong to which component.
So we have to add the two new created classes to the active component. They'll get a “dot”, like the component has, to indicate, that they belong to the active component.

Generating the code

Astade is a code generator. After we created two classes and add them to our component, we want to get the sourcecode for this two classes.
You can get the sourcecode, by selecting “regenerate all” on the component. Astade generates the source files and places them into the “auto” folder.
The former red markers are getting green, to indicate, that the generated sourcecode is identical with the information in the model.

The configuration

Next we need is a configuration. You remember from the last tutorial, a configuration is a folder, where the object files go to and where the Makefile is located.
We did a good Makefile in the last tutorial already. So we simply “copy and paste” (or drag and drop) the configuration “release” from the “Hello1” component, to the “Hello2” Component. It is written common enough, it'll work there, too.

tutorial/helloworld2.txt · Last modified: 2015/05/13 16:45 by thomas
GNU Free Documentation License 1.3
Powered by PHP Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 Valid HTML5