Write cartridge in 10 steps (1)

Source: Internet
Author: User

Write cartridge in 10 steps

This article tells you how to write an andromda cartridge in 10 different steps, using a simple cartridge to generate a build script similar to ant from the UML development model. This is why the cartridge tutorial is called "Andromeda-deployment ".

 

New cartridge task

Written by Matthias Bohlen

Tuesday, 21 March 2006

Let's take a look at the test model that cartridge will handle:



In this figure, you can see four important model element types:

L node: the box that the workpiece can be deployed (usually a machine, such as a server)

L component: Logical Block of software with a defined interface

L artifact: The physical block of the software, such as the JAR file conforming to the Component Interface (in UML, it is "manifest ")

L package: shells around some classes.

The idea behind this model is that the workpiece contains packages and is deployed on nodes. The package contains the classes to be compiled before being packaged into the workpiece.

You can do more from such a model, but this will make this cartridge more complicated for a tutorial. From this model, cartridge generates two types of files:

L a build script like ant (for each node)

L simple reports, components, artifacts, and packages to be deployed to nodes (one report for each model)

From the above model, this new cartridge will generate the following output:

Build. xml:

 

<Project name = "org. andromda. Cartridges. Deployment. sampledeployment. appserver1" default = "deploy">

<Target name = "compile">
<Javac package = "org. andromda. Cartridges. Deployment. sampledeployment. mybackendservices"/>
<Javac package = "org. andromda. Cartridges. Deployment. sampledeployment. mywebapp"/>
<Javac package = "org. andromda. Cartridges. Deployment. sampledeployment. mywebapp2"/>
</Target>

<Target name = "deploy" depends = "compile">
<Jar name = "mybackendcomponents. Jar">
<Package name = "org. andromda. Cartridges. Deployment. sampledeployment. mybackendservices"/>
</Jar>
<Jar name = "mywebcomponents. Jar">
<Package name = "org. andromda. Cartridges. Deployment. sampledeployment. mywebapp"/>
<Package name = "org. andromda. Cartridges. Deployment. sampledeployment. mywebapp2"/>
</Jar>
</Target>

</Project>

 

 

Now, ant experts will say that this is not a valid ant file. No, no. This is a fake goods!

The following is another file to be generated:

<Deployment-report generation-date = "Fri Feb 17 10:12:33 cet2006">

<Node name = "appserver1">
<Component name = "backendcomponent">
<Artifact name = "mybackendcomponents. Jar">
<Package name = "org. andromda. Cartridges. Deployment. sampledeployment. mybackendservices">
</Package>
</Artifact>
</Component>
<Component name = "webcomponent">
<Artifact name = "mywebcomponents. Jar">
<Package name = "org. andromda. Cartridges. Deployment. sampledeployment. mywebapp">
</Package>
<Package name = "org. andromda. Cartridges. Deployment. sampledeployment. mywebapp2">
</Package>
</Artifact>
</Component>
</Node>

</Deployment-Report>

The following describes the design of each step in the cartridge development process.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.