Shrub roses for your garden. An example of using Delphi and Rational Rose together

Gardeners all over the world adore roses and grow them in a wide variety of climates. A kind of revolution in the world of roses was made by the appearance of a new garden group of scrubs - shrub roses. Although almost all of them still require protection for the winter in our conditions, today it is the shrub roses that are the most versatile and unpretentious.

Scrub bushes

The scrubs are very heterogeneous. These are wild species, their hybrids, and modern roses of complex origin, the flowers of which are similar to flowers hybrid tea roses and floribunda group roses.

Rose rugosa and its hybrids

One of the most valuable park roses is the wrinkled rose, or rose rugosa, also called the Japanese rose. The original species is common in our country in the Far East, as well as in Northern China, Korea, and Japan. It exists in two forms: one with white flowers, the other with dark pink or red flowers.

Flowers are from 5 to 10 cm in diameter, very fragrant, in inflorescences of 3-6 flowers or solitary. The flowers of hybrid varieties of rugosa range from white to dark red, there are also yellow ones, they also vary in size and doubleness. The leaves are large, hard, wrinkled. The shoots are densely covered with thorns and bristles. The bushes are wide, dense, reach a height of 1-2 m, and produce strong growth with erect shoots. The root system is powerful and superficial. Flowering is abundant, from the end of May, long-lasting, and can be repeated in a weaker form. Thanks to this feature, the bushes simultaneously contain fruits and flowers. Forms and varieties with double flowers are especially capable of this, which is valuable in decorative terms. The fruits are bright, orange-red, large (2-2.5 cm), very decorative. Rosa rugosa is a very winter-hardy (does not require shelter) and disease-resistant species.

Most rugosa hybrids also do not require shelter for the winter. But some varieties) do not differ in winter hardiness. Their flowering shoots appear on the overwintered upper shoots of the previous year. Without winter protection or deep snow cover, only the lower buds are preserved and are unable to ensure flowering. It is not easy to bend powerful and thick shoots to the ground. Therefore, when choosing a variety, it is necessary to pay attention to general hardiness, frequency and abundance of flowering, and disease resistance.

Rose rugosa and its hybrids are used for small group and single plantings and hedges. These roses make wonderful hedges, especially those that divide the area into separate parts. The fruits are suitable for making jams and compotes.

Hybrids of rose moiesi

The area of ​​distribution of the ancestor of this group is Western China. Hybrids are obtained by crossing the original species with roses of different groups. The flowers are red, pink, medium (5-6 cm), single or semi-double, in inflorescences. The leaves consist of 7-13 oval leaflets. The bushes are tall - up to 2-2.5 m, spreading, with reddish-brown shoots. Flowering is abundant from June, repeated flowering is weaker. The fruits are bottle-shaped, large (5 cm long), dark orange-red. Hybrids of rose moiesi are decorative for landscape gardening. They need light shelter, without bending the shoots to the ground.

Hybrids of rose Cordes

These roses were named in honor of their author - the famous German originator V. Cordes. Most of these roses are obtained from the variety Max Graf (a spontaneous hybrid of Rosa rugosa and Rosa Vihura). As a result of its crossings with varieties from other groups, a varietal group of Cordes rose hybrids was formed. It should be noted that new garden groups are not created without special reasons, and Cordes roses received this honor for their hardiness combined with attractiveness.

The rather large (7-8 cm in diameter) flowers of roses of this group are distinguished by a variety of colors and shapes, from semi-double to densely double, sometimes fragrant, collected in small inflorescences. All varieties have beautiful dark green, shiny leaves. The bushes are vigorous (1.5-2 m), often with whip-like shoots. Blooms abundantly from June to late autumn. The fruits are ovoid. All varieties are quite winter-hardy and disease resistant. Nevertheless, in the conditions of central Russia they require shelter for the winter. They can even be grown in partial shade.
This group of roses is used in group and single plantings, for vertical gardening. They can decorate gazebos, terraces, pergolas, arches, special gratings and other supports for the purpose of dividing garden space, creating recreation areas, and decorating outbuildings.

These roses are not able to wrap around a support, so they need to be tied to it, formed in early spring after pruning, so that they immediately grow in the right direction. Throughout the growing season, the main branches are guided along the support and carefully tied to it.

Shrubs

Scrubs (also called modern park roses) include all varieties that cannot be confidently included in other garden groups.

  • Spectacular appearance. Flowering is abundant, long-lasting (from June to autumn), and repeated. Almost all varieties bloom repeatedly, but there are also varieties that bloom once.
  • Aroma. There are more fragrant roses among scrubs than among hybrid tea roses.
  • Volume. Many varieties stand out for their power and vigor of growth (reach 2 m). The bushes of some varieties are so graceful that their flexible branches require little support, which is soon covered by flowers.
  • Disease resistance and high winter hardiness.

They only require light protection for the winter.

  • Unpretentiousness. Any gardener can grow shrub.
  • Widely used in landscaping.
  • Scrubs can be grown both in single plantings and in small groups (3-5 bushes).

Planting in small groups gives the effect of a large blooming ball of roses; all the irregularities of one bush are hidden by the neighboring ones. The distance between bushes can be from 50 cm to more than 2 m, depending on the width of the bushes. It is impossible to give a general recommendation for planting scrubs because they vary greatly in bush size. On average, 2 to 3 bushes are planted per 1 m2. In large shrub roses, sometimes the bare part of the bush is visible, and then it can be hidden by low-growing roses located in front of them.

A beautiful single bush on the lawn looks impressive. For the role of “soloist”, choose a plant with beautiful shape bush and abundant flowering, with a pleasant aroma. You can plant it anywhere: at the entrance to the house, on the lawn, in the center of the flower bed. Many shrub roses, both old and modern, are good for single plantings. The main thing is that the plant blends harmoniously with the surrounding landscape.

Nostalgic scrubs

The so-called English roses, created by the British David Austin, also belong to the group of scrubs. For many years, this breeder worked on a program to create roses that resembled ancient species, but had modern flower color and the ability to re-bloom. English roses are obtained by crossing French, Damask, Bourbon and other roses with modern varieties of hybrid tea roses and floribunda roses. D. Austin's roses appeared in the last quarter of the twentieth century. Their flowers are densely double, of various colors: pale apricot, deep yellow, dark red, peony-shaped, very fragrant and look nostalgically old-fashioned. The bushes are compact, well shaped, and repeat flowering. Many varieties are disease resistant. The merit of D. Austin is that he again instilled in the world a love for old flower forms ( for a long time Goblet-shaped roses of the hybrid tea type were considered ideal), as well as the three-dimensional structure of the bush.

The most popular varieties of this group are Abraham Darby, Graham Thomas. Largely thanks to English roses, gardeners learned about the group of scrubs. The climate of the middle zone is a little harsh for them. Therefore, their shoots must be carefully covered for the winter.

Roses from the French company Meilland in the Romantica series are also distinguished by their durability, abundant repeat flowering, variety of shades, ruffled petals, and the charm of old roses. True, only a few varieties from this group belong to the group of scrubs, for example Collette, Les Quatre Saisons, Yellow Romantika, Lovely Meilland. All varieties are distinguished not only by their beauty and “antique” appearance, but also by their sustainability. They are the dream of any romantic garden. The German company Rosen Tantau has also been breeding modern nostalgic roses for many years. All varieties are tested for disease resistance and frost resistance in harsh climates. New varieties of nostalgic scrub roses: Belvedere, First Lady, Gartentraume, Grafin von Hardenberg, Mariatherese, Pasella.

Roses of the Canadian Explorer Roses series (Charles Albanel, David Thompson, Henry Hudson, Jens Munk, Martin Frobicher), named after outstanding Canadian explorers, are distinguished primarily by their high winter hardiness. The origin of many varieties in this series involved the rose of cordesia and the rose of rugosa.

Features of care

Shelter for the winter

Although the winter hardiness of modern shrub roses is higher than that of hybrid tea and floribunda roses, they must be covered for the winter, and the covering itself can be more difficult due to the volume of the bushes.
Repeatedly blooming shrub roses can reach 1.5 m in height or more during the growing season. At the end of October, autumn pruning is carried out - to 1/3 of the length of the shoots.

You should try to bend the shoots of tall scrubs to the ground. Bushes can be dug up on one side and laid by pinning them to the ground. The bent branches are placed on a layer of spruce branches, otherwise the roses may rot in the thawed soil under cover. The top is also covered with spruce branches or any insulating material. You can use earth to secure the insulating material on top.

Reliable protection for bushes that have gone through the normal stages of hardening can be a strong snow cover. Under a layer of snow of 50-70 cm, the temperature does not drop below 4-5° below zero when the temperature outside is 25-30° C. But since the time of snowfall and the thickness of the snow cover are not constant, it is necessary to use additional protection techniques: spruce branches, oak sheet, non-woven material.

Trimming

Shrubs are characterized by strong voluminous growth and require light pruning. These roses are afraid of heavy and even moderate pruning. Dormant buds take longer to wake up than, for example, hybrid tea roses. With a short summer, and not always warm enough, this feature becomes significant. With long pruning, flowering is more abundant, since second-order shoots from the upper buds develop more intensively.

3-5 of the strongest new basal shoots are left on the bushes and 6-8 or more well-developed buds are left on them. The goal of annual pruning is to shorten shoots by a quarter or half, lateral shoots by two-thirds. If the height of the shoot reaches 120 cm, shorten them by 30-40 cm, if the length of the side shoot is 30 cm, shorten it by 10 cm. It is necessary to leave fairly strong, evenly spaced shoots.

Currently Delphi is one of the most popular software products for creating information systems. On its basis, both small programs and enterprise-scale systems are created. What is so attractive about this product from a developer’s point of view? First of all, it is, of course, an excellent visual programming environment - understandable, easy to learn and often does not require the knowledge of a professional developer (which, as we know, accumulates bit by bit over many years and decades and is incredibly expensive). In the Delphi environment, you can create quite complex software systems almost from scratch, writing a minimum of code. At the same time, the language Object Pascal, in which the program is written, is familiar to many (at least in our country), and is currently studied in junior courses in most domestic technical universities.

However, not everything is so simple. If to create small software systems for your own needs you can limit yourself to a visual programming environment, then to create anything quite critical to quality software(software) requires a fundamentally different approach, at a minimum - use when developing a life cycle model BY, with all the ensuing requirements for documenting the process.

Fundamental for systems of this class is the presence of a basic architecture, which is unchanged throughout the entire life cycle of development and operation of the system and the main elements of which are laid down in the early stages of design. The basic architecture is created, as a rule, using a number of models that reflect the main points associated with the structure of the system and its functions. Unfortunately it's Wednesday Delphi is not applicable for solving such problems.

But let's return to the advantages of Delphi. If we discard the visual programming environment, then what remains? Object model. And this advantage of Delphi is attractive from the point of view of the system designer. It is the object model (no matter how strange it may seem to someone) that largely determines the success of the visual programming environment. The Delphi object model covers a wide range of tasks, providing high-level, yet extremely flexible, virtually unlimited organization tools. user interface, operating system resource management, database manipulation, standards support open systems, as well as support for popular technologies (including CORBA And COM), multi-level architecture and, finally, Internet-intranet- technologies.

The basic architecture can use elements of the Delphi object model (why re-create all of the above), supplementing it with the necessary components that reflect the application specifics of a particular system.

We use the product for system design Rational Rose companies Rational Software Corp.oration. This product has all the necessary characteristics to create the basic architecture of a system of any scale. If you have sufficient programming experience in the Delphi environment, using Rational Rose and Delphi together, within a single technological process, seems appropriate to us.

The purpose of this article is to look at the combined use of Rational Rose and Delphi and accurately (of course, in our opinion) indicate the place of each product in the development process. We hope that this will allow developers to formulate an opinion on the applicability of such technology for their own needs and save time on studying the details.

What we want from Rational Rose and Delphi

Methodology we follow during development BY, is a software development methodology Rational Unified Process from Rational Software Corporation. The methodology, from a technological point of view, includes the following stages (of course, within each iteration): domain modeling, determination of system requirements, analysis and design, implementation (coding and offline debugging), testing and implementation. The table below shows what we can expect to achieve with Rational Rose and Delphi at each stage.

Using Rational Rose and Delphi at various stages of software development

Stage What we expect from Rose What do we expect from Delphi
Domain Modeling The subject area is modeled and the subject area is described “as is” -
Determining system requirements Functional requirements for the system, requirements for the system interface are determined A user interface prototype is created
Analysis and design The basic components of the architecture are determined, the data is modeled, and the system components are designed in detail. Elements of the Delphi object model are included in the base architecture. Ensures a one-to-one correspondence between Rose class diagram elements and Delphi component elements
Implementation Class diagrams are implemented in the form of software modules, component diagrams and placement diagrams are developed The program code is implemented, ensuring unambiguous compliance of the project in Rose and Delphi. Documenting Code in Delphi Reflects in Rose
Testing The models remain virtually unchanged. Test cases are developed to test system functions Changes are made to the program code. Changes in program code are reflected in Delphi code
Implementation Layout diagrams are the basis for software implementation. Based on the models, up-to-date system-level documentation can be obtained -

As can be seen from the table, the main interaction between Rose and Delphi can occur during the system requirements definition, analysis and design and implementation stages. The main models used at these stages are: a model of system functions, an interface model, a data model, and a model of software module specifications.

To enable communication between Delphi and Rose, a middleware called a code generator is used. It should be noted that, strictly speaking, the tasks of this software are not limited to code generation.

Before we move on to the description of a specific code generator, we list what, in our opinion, it should provide:

  • be able to convert Rational Rose classes into class definition code in the target language (in this case Delphi ) . In this case, the description associated with a specific class must be placed in the appropriate place in the program code;
  • support for a class diagram stereotypes associated with specific features of the language (for example, the stereotype unit, interface or property with corresponding definitions: specific package - Delphi module , class - Delphi interface, attribute - property for a Delphi component);
  • have a described, obvious and unambiguous way to map a class diagram to Delphi code. In this case, the display must be customizable;
  • be able to import the current Delphi object model (preferably for different versions libraries VCL);
  • support code generation for creating Delphi classes;
  • be able to correctly display typical types of connections between classes (at least generalization, aggregation and composition);
  • be able to display the cardinality of the connection in the program code;
  • Based on the Rose component diagram, create a Delphi project containing the required software modules (forward engineering);
  • based on a ready-made Delphi project, build a Rose component diagram containing in the form of components all modules of the Delphi project and associated classes obtained from Delphi as a result of reverse engineering ( reverse engineering). Diagrams should be compact and obvious;
  • provide automatic reconciliation between the Rose and Delphi models after changes are made to the code of the Delphi modules ( round trip engineering);
  • after making changes to the Rose model and re-generating the code, do not destroy fragments written in the Delphi environment;
  • in addition to code generation, have a way to display such an important Delphi element as forms;
  • work on real projects (hundreds of classes and modules) with acceptable performance.

Delphi code generator from Ensemble Systems, Inc.

Company Ensemble Systems, Inc. is currently one of the leading suppliers of additional components (add ins) for Rational Rose . These components support code generation for a wide range of popular programming systems, including Delphi. Let's look at how the Delphi code generator works in the Rational Rose environment.

After installing the Delphi component from Ensemble Systems, Inc. in the Rational Rose environment, a new menu item appears in the Tools section (Fig. 1).

The code generator is called Rose Delphi Link (RDL). How to use RDL , we will describe in the plan when we consider concrete example. Now we will focus on the main features of RDL, without an understanding of which it is unlikely that RDL can be used effectively.

First, note that the code generated by RDL does not contain implementation (for an object model this is usually the method body). When a model is updated from Delphi code (reverse engineering or round trip), the model does not load Delphi code for method bodies. Changes in the model concern only declarative elements: definitions of classes, interfaces, types, records, etc. However, when re-generating code from Rose, the method bodies in Delphi also remain unchanged, and only the declarative elements change. Therefore, it is impossible to “spoil” the program code when re-generating it. To map model elements into program code, RDL uses Code Generation Properties (C.G. P) is a set of special tables that are associated with each element of Rational Rose models and contain Delphi-specific information used for code generation. A set of these tables (Fig. 2) is available from the main menu (item Tools/Options, bookmark Delphi).

In order for CGPs for Delphi to be available from the specification, the value of the field must be set Default Language = Delphi in the bookmark Notation menu item Tools/Options. To simplify work in the menu section Tools/Ensemble Tools a bookmark also appears Delphi Property Editor, where you can configure the properties of the selected model element. Note that the use of CGP is a typical technique for all code generators from Ensemble Systems, Inc. and for Rational Rose in general. When using the Delphi Property Editor, you can view the code of the corresponding model element (for example, a class) without performing code generation, which is often very convenient.

Now let's look at how RDL maps common design practices into program code.

1. Inheritance from a class and implementation of an interface

Converts to code:

Type SampleClass1 = class (BaseClass, SampleInterface) (...) end;

2. Associative connections with roles and different cardinality of connections

Converts to code:

Type SampleClass3 = class private ArrayRole1: array of SupplierClass2; ArrayRole2: array of SupplierClass5; ArrayRole3: array of SupplierClass3; ArrayRole4: TItems; end;

Note that to represent roles with cardinality not equal to 1, arrays (either fixed length or dynamic) are used. The SampleRange constant in the example must be defined in the Array_Range property for the ArrayRole. Note that for Role4 the code does not define an array, but rather a TItems type that is supposed to represent a collection.

Converts to code:

SampleClass1 = class Public A: SampleClass2; B: SampleClass3; C: array of SampleClass4; D: array of SampleClass5; end;

Keep in mind that we did not find any significant difference in the code for aggregation and composition, and the resulting code is very similar to the code for regular role association.

4. Stereotypes for typical Delphi code elements

RDL has several stereotypes to represent typical Delphi code elements: pointers, arrays, files, class references, etc. True, in our opinion, these elements are rarely used in high-level design of an object model.

At the end of the brief description of the features of RDL, we note the following. An important design element is the documentation in the specification for the corresponding model element. RDL ensures its transfer into program code. So, for operations (methods of the Delphi class), the field value documentation in the specification, it is inserted into the code before the method definition. Conversely, comments in Delphi code can be converted into documentation fields in Rose model element specifications.

What RDL can't do

Previously, we defined what we think a Delphi code generator should provide. In general, RDL covers all of the above features, perhaps with one exception - it doesn't allow you to create forms. Can you imagine a Delphi environment without forms? We can't either. The main paradigm of visual programming in the Delphi environment consists of setting the values ​​of the corresponding properties (class attribute values) and writing code for event handlers. And, unfortunately, RDL is not our help with this. But is this really such a serious limitation? There may be different opinions here.

One of the ways to create an application is as follows: the user interface is designed in the Delphi environment (and where can this be done faster and easier?) and the program code is converted into Rational Rose models. Despite the fact that the forms turn out to be quite bulky, they can be “combed”, but the main thing is do not display unimportant details in them. In Rational Rose, the actual object model, data model, and component model are designed, that is, architecturally significant elements. In combination with the system user interface model, they form a system structure that can be tracked by configuration management tools, included in documentation, easily analyzed for fundamental errors, and is the basis for functional testing, that is, can be used at any stage of the life cycle ( life cycle) software development. At the same time, RDL ensures complete coordination of models and program code throughout the entire software life cycle. We try to adhere to exactly this approach.

An example of using Delphi and Rational Rose together

Unfortunately, it is hardly possible to demonstrate a full-fledged example of a real application in a short article. However, this is not required. At the point in the article where we described what we expect from Rose and Delphi at each stage of development, we noted that it is important for us when designing to create a basic architecture, in this case, including elements of the Delphi object model. This is where we will demonstrate the capabilities of RDL.

As an example, we chose a fragment of a system that displays indicators of a patient’s condition for the attending physician. The functional requirements for the system are presented in the form of a diagram (Fig. 3).

The diagram shows three active objects: administrator, device, doctor. We will not consider system functions related to the device. In relation to the device, it is important for us that the indicator is obtained at a certain frequency and that the system provides an interface for storing it in the database. All remaining functions of the system are related to the user interface and provision of information storage in the database or its retrieval.

We base the system on the following architectural solutions:

  • user interface ( GUI) the system is built on the basis of the Delphi object model;
  • the interface with the DBMS is based on the Delphi object model;
  • A relational DBMS is used as a DBMS.

When designing a system, we must define: classes to represent the user interface ( boundary classes); control classes that implement the logic of the system ( control classes); entity classes for displaying the information storage structure ( entity classes).

The entity classes we designed are presented in Fig. 4.

From the object model of entity classes, we obtained a physical data model for a relational DBMS and ensured its generation for a specific DBMS. We omit the details of how this can be done in the Rational Rose environment here.

As we plan building a GUI Based on the Delphi object model, it is reasonable to assume that the classes for representing the user interface (boundary classes ) can be obtained by prototyping the user interface in the Delphi environment. Classes user interface (boundary classes ) are being designed for the form shown in Fig. 5.

In the class diagram, we removed attributes and operations for all classes of the Delphi object model: since there are several dozen of these attributes and operations in each class, the diagram in this case would become immense. The diagram clearly shows which Delphi object model classes are used to represent user interface elements and what exactly they represent. You should immediately exclude from the model representation TGroupBox And TLabel as architecturally unimportant elements. The class diagram for the table editing form is shown in Fig. 8.

In addition to the main window, we also need an interface (GUI) for maintaining a database of patients, types of indicators and units of measurement. For this we plan to use a standard form of table editing based on standard Delphi components. Let's draw this form in Delphi and convert it to the Rational Rose model (Fig. 9).

Using the inheritance mechanism, we obtain all other screen forms from the tabular editing form. An example of what the observation type directory will look like is shown in Fig. 10.

So, with appearance We have completely defined the user interface, and now we can focus on implementing the logic of the application. For convenience (but don’t take this as a standard practice!) we will use an already existing interface class as a control class TMainForm.

The TMainForm class must provide:

  • navigation between screens, handling button click events to display other forms;
  • filling out drop-down lists, patients, indicators, units of measurement;
  • automatic calculation of the unit of measurement by indicator type;
  • selecting a patient by card number;
  • selecting a card number for the patient;
  • calculation and display last value indicator.

Let's create operations in the Rational Rose environment to implement the functions of the TMainForm class described above (Fig. 11).

The operations of the TMainForm class should be divided into two groups: calculations and reactions to events. Operations ending with Click or Change, and also FormShow- reactions to events, the rest is calculations.

Operations must implement the following:

  • FillPatientLis t - filling out the drop-down list of patients;
  • FillMeasureList- filling out the drop-down list of units of measurement;
  • FillObservList- filling out the drop-down list of observation types;
  • CalcObservVal- calculation of the last observed value;
  • ChPatientByCard- search for a patient by card number;
  • ChCardByPatient- search for card number by patient;
  • ChMeasureByObserv- return the unit of measurement for a given type of observation;
  • CardValChange- reaction to changing the card number;
  • PatientChComboChange- reaction to the selection of a new patient on the list;
  • ObservTypeComboChange- reaction to the choice of observation type;
  • GetValueButtonClick- reaction to pressing the value calculation button;
  • PatientDictClick- response to pressing the Patients button;
  • ObservTypeDictClick- reaction to pressing the button Types of observations;
  • MeasureDictClick- reaction to pressing the Units of measurement button;
  • FormShow- processing when the form is first displayed on the screen.

And the last thing needed to complete the design is control classes to implement interaction with the database. Without them, neither filling the database nor implementing settlement operations of the TMainForm control class is possible. As in the case of interface classes, we will use the environment Delphi to design a control class for interacting with the database - TDataModule1, and then perform model matching. The new module for interacting with the database is shown in Fig. 12.

Object based QueryPatient, QueyObType, QueryMeasures And PatientDataSource, ObTypeDataSource, MeasureDataSource work with a database of patients, types of observations and units of measurement is implemented - in a standard Delphi way, based on the use of a pair of class objects TQuery, TDataSource and their interaction with GUI classes. ObservDataSource used to access information about observations made. To describe the interaction of control classes TDataModule1 And TMainForm you should create several interaction diagrams related to the execution of the required queries to the database (due to the limited scope of the article, we omit these diagrams).

Note that in the process of adding new modules and classes to the system and harmonizing models, we automatically received a component model of the system (Fig. 13).

So, let's summarize briefly. As a result of joint use of Rational Rose and Delphi, we received:

  • interface and control classes organized into packages;
  • component model of the system.

Entity classes and diagrams that describe dynamics are designed in Rational Rose. In the future, Rational Rose models provide us with a basis for documenting the project, tracking its status and organization functional testing. The project obtained in Delphi is, in turn, the basis for the implementation. During the implementation process, the project is periodically coordinated in Delphi with the Rational Rose model based on the technology round trip, which allows you to keep models up to date and smoothly evolve them in accordance with changed requirements for the system.

Conclusion

In conclusion, we want to draw attention to those stages where, in our opinion, the joint use of Delphi and Rational Rose makes the most sense from a technological point of view.

Firstly , is the creation of a user interface prototype. Quick creation forms in the Delphi environment also allows you to quickly obtain a model of interface classes in Rose, highlight on its basis fundamental architectural points (for example, common behavior, typical GUI elements, redundancy), and also compare interface classes with functional requirements for the system.

Secondly , this is the creation of control classes in Rational Rose models with subsequent code generation in Delphi. Control classes are presented more clearly in the Rational Rose environment when using UML (in Delphi they can be “blurred” among large interface classes).

And finally, thirdly , this is the stage of program code implementation at which changes can be made to the model related to implementation issues. Periodic coordination of models at this stage allows the developer to ensure that the fundamental architectural decisions have not undergone significant changes, and also to have up-to-date models that reflect the actual state of development.

ComputerPress 4"2001

When the royal beauty climbing rose “Elf” blooms, it will take anyone’s breath away. Like a fairy tale, the opened inflorescences appear in a beautiful light cloud, snow-white from afar, and with a pleasant lemony freshness up close. This enduring splendor delights the entire season and evokes romantic thoughts. The hand reaches out to the flower, but not to pick it, but only to touch the unearthly creation and inhale the mesmerizing aroma.

The elf cannot live without love, but it is also impossible not to love him.

The climbing rose "Elf" was bred by the German company Tantau ("Nostalgic Roses" series) in 2000 and is a modern Large-Flowered Climber (LCI) garden rose.

Breeders have created a plant with an exquisite combination of an elegant silhouette and gentle nostalgic romanticism. Here the name itself is consonant with its appearance, as if emerging from a fairyland.

Description

The bush is vigorous (up to 280 cm in height, less often up to 250) and erect. Climber shoots sometimes reach three meters.

The flowers are large, up to 14 cm in diameter, densely double. Each flower glass amazingly holds up to 57 petals. Their unique color of noble ivory at the edges gradually transitions to a pale green with a lemon tint at the base. Maybe that’s why the aroma is original - delicate, slightly fruity, bewitching and alluring.

Under favorable conditions, during mass flowering, one peduncle simultaneously throws out up to five flowers in an umbellate inflorescence.

The leaves are large, bright green. The sun loves to preen itself in the reflection of the glossy foliage.

Agricultural technology

  1. Conditions. The climbing rose "Elf" needs warm, sunny places. The soil should be fertile and light, slightly acidic or neutral. The main thing is that it retains moisture well. Like all its relatives, it needs regular feeding (horse manure, for example) and shelter for the winter.
  2. Landing. In the spring, before planting, the seedling is soaked in water for a day. During this time, the root system will have time to become saturated with moisture. Then the weak shoots of the plant are cut off and the strong buy generic accutane are left. Damaged and long roots are trimmed.
  3. Sustainability. The “Elf” variety is quite frost-resistant, and even manages to retain foliage. But at very low temperatures freezing is possible. Does not suffer from powdery mildew or black spot. But flowers do not like rain and shade.
  4. Support. If the rose is guided along a thin, inconspicuous support, then the powerful side shoots will create the image of a soaring tree with many magnificent buds.

“Elf” looks perfect in a romantic garden in the form of arches, decorates walls and gazebos. Lemon-cream cascades will bow picturesquely under the weight of large flowers, the petals of which were carved by a skilled “master”. This rose is for romantic lovers and those who have an extraordinary sense of style. And if you plant verbena, catnip, and lavender at its foot, then their delicate leaves and airy, lush inflorescences will beautifully frame and complement the beauty of the climbing rose.

The plant is in lush bloom, like fairy-tale elf women full of bright emotions. Rose “Elf” can be changeable and capricious, at the same time it is full of charm, the ability to bewitch and change the world with its beauty. The fairytale bush brings a nostalgic touch to our everyday life, and it’s so beautiful.


The material was published in the March
issue of the magazine "Programmer" for 2002

Company

Rational Software For several years now it has been a leader in the creation of tools for design, development, testing and maintenance of software. The main product in the line Rational is the Rational Rose CASE tool. Rational Rose supports visual object-oriented modeling ( UML ), supports code generation and reverse engineering (building a model from program code) for many programming languages, allows you to build an object model of the developed software system, define specifications of classes, objects, attributes and operations (for more details, see “Programmer” No. 2, 3, 5/6 for 2001). Rational Rose has all the necessary characteristics for designing a system architecture of any scale, the idea of ​​using Rose with such a powerful and popular programming system as Delphi . Standard delivery Rational Rose it is not possible to work with Delphi, but Rational Software conducts a program to support third-party manufacturers of bridge programs ( Links) between Rose and other development tools. As part of this program, the company Ensemble Systems a bridge program was developed Rose Delphi Link (RDL) connecting Rational Rose and Delphi . Basic functions RDL - code generation and reverse engineering. It should be remembered that the generated RDL the code does not contain the implementation of the functionality! Only declarative elements are generated: definitions of classes, interfaces, records, types, visibility directives, etc.

Distribution

Rose Delphi Link can be downloaded for free from the site Rational Software (http://ftp.rational.com/public/rose/Links/RoseDelphiLink3Setup.exe ), size – about 8 MB. Installation RDL standard, does not cause any difficulties. After installing the program in In Rational Rose, a new item Ensemble Tools ® Rose Delphi Link appears in the Tools menu (Fig. 1).

1. RDL menu item

Before moving on to review

Rose Delphi Link , let me remind you of the main stages of working in the environment Rational Rose . Typically the following approach is used:
  1. Determining system requirements and building a model of interaction between system elements (
Use Case Diagram and Collaboration Diagram ). For details Use Case used Sequence Diagram . These diagrams display domain objects involved in business processes. These diagrams do not affect the generated code.
  • Construction of a hardware model of the system (
  • Deployment Diagram ). This diagram shows the system model in hardware implementation. The diagram does not affect the code generated R.D.L.
  • Development of an object model of the system (definition of classes, their interactions, attributes, operations). In parallel with the development of a class diagram, as a rule, a component diagram is developed (
  • Component Diagram ), which displays the interaction of files, modules, and additional libraries used in the system. The component diagram also does not affect code generation.
  • Generating program code.
  • Only class diagrams affect code generation, so for the purposes of this article we will only consider section diagrams

    Logical View . Features of constructing other diagrams are omitted.

    The listed design stages in the environment

    Rational Rose used to develop a model and generate code in various languages ​​supported by the environment Rose. But in Delphi there is a feature that significantly distinguishes development in Delphi from development in other programming environments: user interface programming. It's no secret that in Delphi The development of most programs begins with the design of the user interface, and with further programming - its significant changes. Therefore, use the standard approach Rational Rose not very convenient. To solve this problem the company Ensemble Systems proposes the following design methodology:

    Figure 2. Design methodology using

    RDL

    The main idea of ​​this approach is to use reverse engineering (

    Round-trip engineering ): all changes made at the program code level in Delphi , are displayed in the object model built in Rose , and vice versa, when changing classes, methods, etc. in the object model Rose , respectively,The program code is corrected. Notice the pair of arrows that connect the third and fourth blocks. These arrows represent the reverse engineering process.

    Let's look at the main window

    Rose Delphi Link (Fig. 3). The interface is quite simple, it contains:
    • a menu containing commands for working with the project, setting options and calling for help;
    • panels on which the hierarchical structures of models are displayed in the form of trees
    Rose and Delphi;
  • object trees update button, reverse engineering buttons (¬
  • Update All) and direct design, i.e. code generation (Update All®).

    Figure 3. Basics

    Rose Delphi Link window

    Main window

    RDL is a child of the main window Rational Rose and is constantly located on top of this window, minimized like this the same as a child window, which is undoubtedly very convenient.

    Before looking at a specific example, let’s take a closer look at the menu items

    Rose Delphi Link.

    File ® Open Project – serves to open in RDL created project Delphi . When opening a project in a window RDL The object trees of the opened project are displayed.

    File® New Project– when selecting this menu item RDL suggests creating an empty one Delphi -project. The project file created in this case contains only declarative elements,required for the minimum program Delphi (program, begin, end ). A new project should be created if the program does not contain a graphical user interface, for example, a dynamic library. However, in this case, an adjustment will need to be made to the generated code - replace program on library . Using the context menu you can create modules ( unit ) and additional directories for modules. Modules created in this way also contain only a minimal implementation ( uses, interface, implementation, end ). After creating the module, during subsequent code generation, in the section uses a new module declaration is added to the project file.

    Menu items View And Helpare standard and do not need description within the scope of this article.

    Now let's use the above design methodology and develop a program and its corresponding model

    Rose . For example, let's take a program that fills two numeric arrays of size 5 by 5 random numbers, as well as implementing some mathematical functions for their processing. The program must perform the following functions:
    • Fill arrays with random numbers ranging from 1 to 10;
    • Calculate the sum of the elements of each array;
    • Determine the arithmetic mean of elements;
    • Clear arrays (initialize them to zero).

    Let's start with developing the user interface in

    Delphi . As a result of simple actions with the mouse, I got the following program, which does not yet perform any actions (Fig. 4).

    Figure 4. Interface of the developed program

    Let's save this project with the module names suggested

    Delphi by default, open new project Rational Rose, and launch Delphi Rose Link . Select a menu itemOpen Project,and open the one just saved in Delphi project. In the RDL window the model object trees will be displayed Rose and the Delphi project (Fig. 5).

    Figure 5. Project

    Delphi open in RDL

    The left object tree is model objects

    Rose , the right tree is the objects declared in the source code Delphi . Notice the red exclamation marks to the left of the icons representing objects. They indicate differences between the code Delphi and Rose model . All icons are now checked, since the models in Rose does not yet exist at all.

    The next step is model generation

    Rose by source code. To start generating, you need to press the ¬ buttonUpdate All.In case of successful generation exclamation marks objects disappear, which means that the model Rose for each object corresponds to the source code Delphi . To view the history of generation messages, you need to select the menu itemView ® Messages. A fairly detailed log of messages will be displayed in the window that opens. RDL , output when generating a model or source code. Rose Delphi Link , and in the object browser Rose, select the Logical View branch . We see two packages appear:<>Unit1, which contains the object model of the code from the module Unit1.pas, and External References,containing objects Delphi , which are declared in modules outside the current project (library objects VCL).

    Now let's open it in the environment

    Rose class diagram corresponding to the module Unit1 ( Logical View ® Unit1 ® Overview). In its original form, the diagram shows a slightly confusing object model, which we will put in order by carefully arranging the objects according to their hierarchy (Fig. 6).

    Figure 6. Module object model

    Unit1

    When the interface of the program being developed is quite complex and includes more than a dozen elements, the object model becomes somewhat overloaded. In order to unload the model, you can remove some non-essential elements from the model. You only need to delete elements from the diagram, since in this case they are removed only visually. When objects are deleted from the browser, they are permanently deleted, and this entails a change in the generated

    RDL code.

    Now let's move on to the next step: developing an object model that implements the program functionality specified above. We will implement the classes, their attributes and methods in a separate module; in the main module we will create instances of the classes, and in the button press event handler we will write calls to the methods of these classes.

    Let's create a new module. This can also be done in

    Delphi, and Rose, and RDL , but for the purity of the experiment we will create everything only in R.D.L. In Rose activate the window RDL and click right click mouse over the root element in the model object tree Rose - in our case it is Model1.mdl . In the context menu, selectNew ® Unit.The component editor window will open ( Component Editor ) (Fig. 7). On the tabGeneralthe module name is indicated ( Unit 2), and a comment for the created module, which will be inserted into the module as a comment during code generation. On the tabDetailthe type is indicated ( kind ) component, and the path to source file. On the tabCode Previewyou can see the code that will be generated RDL for this module. Switch offAllow Code/Model Updatesprohibits code generation and model updating for the selected element.

    Figure 7. Component editor

    After pressing the button

    Okwe see what's in the window RDL an icon indicating a new module appeared, and next to it exclamation mark, signaling that the model Rose and Delphi code not synchronized. Let's update the code Delphi by clicking a button Update All®.

    Now you need to switch to

    Delphi . We see a window warning that the module has been changed (Fig. 8). To download the updated module, clickOk.

    Figure 8. Message

    Delphi about changing the project file

    Now let's open the newly generated module

    Unit2.pas . You can verify that code generation was successful - all necessary keywords, comment inserted. The next step is to model the classes and their methods in this module. Let's go to Rose , and activate the window RDL . In the object tree we will display a context menu on the object Unit 2 and select itemsNew ® Class. The class editor window appears ( Class Editor ) (Fig. 9). On the tabGeneralyou need to specify the class name ( Name), Kind, Visibility ) and a class comment ( Documentation ). In our case, the class will be called TMassiv , the scope for it is Public

    Figure 9. Class editor

    To create all methods and attributes of a class we will use the menu item

    Newin the class context menu in the object tree RDL . Attribute and method editors are basically similar to the class editor, so we will omit the creation details. Let's create the following attributes and methods (all methods with visibility directives Public, M attribute has the appearance Private):

    M: array of Integer;

    ; // Initialize the array

    procedure FillMassiv

    ; // Filling the array with random numbers

    procedure CalcSum

    ; // Calculate the sum of array elements

    procedure CalcSr

    ; // Calculate the average value of array elements

    function GetElement(X, Y: integer): Integer; //

    Getting array element (x,y)

    Let's also create a method for the class

    TForm 1, which will fill the components TMemo , located on the form, elements from arrays:

    procedure GetMassiv;

    There is something special about creating methods with parameters. First, the method is created in the usual way, then, in the object tree

    RDL , in the context menu on the method for which you are asked to specify a parameter, select the itemNew ® Parameterand the name of the parameter, its type and a comment for it are indicated.

    After creating the class, take a look at the class diagram for the module

    Unit2 in Rose – our class is mapped according to the specification UML (Fig. 10).

    Figure 10. Class diagram with the created class

    So, the class has been created, or rather its shell, without implementation yet. Now in the main module

    Unit1 Let's create two instances of this class. Let's declare them as M1 and M2 in the Public section of the TForm class 1. This is done by selecting the necessary items in the context menu of the object tree and specifying the parameters in the attribute editor. Modified diagram where in class TForm 1 shows declared instances of the class, shown in Fig. 11.

    Figure 11. Class instances declared in a section

    public class TForm1

    So, the model is built, and now we need to generate the final code. In the window

    RDL click Refresh, Update All®and go to Wednesday Delphi . Now we need to write code that implements the functionality and compile the program. When populating methods with code, you sometimes need to add local or global variables. This can be done in RDL , but it's better to implement these variables in code and then update the model Rose by source code Delphi (¬ Update All). If some elements have been removed from the model, but they are already implemented in the code, this code is contained between compiler directives($IFDEF DELETED) and ($ENDIF) .

    After implementing all the source code in

    Delphi back to RDL and reverse engineer again by pressingRefresh And ¬ Update All. TForm class 1 has changed - methods have appeared in it - button event handlers (Fig. 12). In our case, this is the final version of the class diagram and the entire model as a whole.

    Figure 12. Final class diagram for the module

    Unit1

    Final source code programs and built model

    Rose can be downloaded from the magazine's website.

    In the example considered, we followed the application development methodology proposed by the developer

    Rose Delphi Link , and as a result we received an object model of the system. All classes and diagrams describing the activities of the system were designed in Rational Rose using the program Rose Delphi Link.

    So, let's highlight the main advantages of sharing

    RDL and Rational Rose:
    • quick and convenient creation of a user interface prototype;
    • opportunity to get detailed model interface classes, and on its basis highlight the fundamental architectural features of the system;
    • the ability to compare classes with functional requirements for the system;
    • ability to create control classes in models
    • Rational Rose followed by code generation in Delphi;
    • full support of the life cycle of the developed software system when using other company products
    • Rational.

    Thus, with periodic coordination based on reverse engineering technology, compliance with the model is ensured

    Rose and Delphi code , which allows the developer to ensure that the architectural solutions have not undergone significant changes, and also to have up-to-date documented models that reflect the actual state of the project development.

    Literature:

    1. Vendrov A.M. Design of software for economic information systems. – M.: Finance and Statistics, 2000.
    2. Trofimov S.A.
    3. CASE -technologies: practical work V Rational Rose – “Publishing house BINOM”, 2001
    4. Butch G., Rambo D., Jacobson A. Language
    5. UML . User's Guide: Per. from English – M.

    Rational Software has been a leader in software design, development, testing and maintenance tools for several years. The main product in the Rational line is the Rational Rose CASE tool. Rational Rose supports visual object-oriented modeling (UML), supports code generation and reverse engineering (building a model from program code) for many programming languages, allows you to build an object model of the software system being developed, define specifications of classes, objects, attributes and operations (for more details, see "Programmer" No. 2, 3, 5/6 for 2001).

    Since Rational Rose has all the necessary characteristics for designing the architecture of a system of any scale, the idea of ​​using Rose with such a powerful and popular programming system as Delphi suggests itself. Rational Rose does not come standard with Delphi, but Rational Software has a program to support third-party bridge programs (Links) between Rose and other development tools. As part of this program, Ensemble Systems developed the Rose Delphi Link (RDL) bridge program linking Rational Rose and Delphi. The main functions of RDL are code generation and reverse engineering. It should be remembered that the generated RDL code does not contain the implementation of the functionality! Only declarative elements are generated: definitions of classes, interfaces, records, types, visibility directives, etc.


    Figure 1. RDL menu item

    Before moving on to reviewing Rose Delphi Link, let me remind you of the main stages of working in the Rational Rose environment. Typically the following approach is used:

    1. Determining system requirements and building a model of interaction between system elements (Use Case Diagram and Collaboration Diagram). Sequence Diagram is used to detail the Use Case. These diagrams display domain objects involved in business processes. These diagrams do not affect the generated code.
    2. Construction of a hardware model of the system (Deployment Diagram). This diagram shows the system model in hardware implementation. The diagram does not affect the code generated by RDL.
    3. Development of an object model of the system (definition of classes, their interactions, attributes, operations). In parallel with the development of a class diagram, as a rule, a Component Diagram is developed, which displays the interaction of files, modules, and additional libraries used in the system. The component diagram also does not affect code generation.
    4. Generating program code.
      Only class diagrams affect code generation, so for the purposes of this article we will only consider diagrams in the Logical View section. Features of constructing other diagrams are omitted. The following Rational Rose design steps are used to develop the model and generate code in the various languages ​​supported by Rose. But Delphi has a feature that significantly distinguishes development in Delphi from development in other programming environments: user interface programming. It is no secret that in Delphi the development of most programs begins with the design of the user interface, and with further programming - its significant changes. Therefore, using the standard Rational Rose approach is not entirely convenient. To solve this problem, Ensemble Systems offers the following design methodology:


    Figure 2. Design methodology using RDL

    The main idea of ​​this approach is to use reverse engineering (Round-trip engineering): all changes made at the program code level in Delphi are reflected in the object model built in Rose, and vice versa, when classes, methods, etc. are changed. in the Rose object model, the program code is adjusted accordingly. Notice the pair of arrows that connect the third and fourth blocks. These arrows represent the reverse engineering process.
    Let's look at the main Rose Delphi Link window (Fig. 3). The interface is quite simple, it contains:

    • a menu containing commands for working with the project, setting options and calling for help;
    • panels that display the hierarchical structures of Rose and Delphi models in the form of trees;
    • button for updating object trees, buttons for reverse engineering (Update All) and forward engineering, i.e. code generation (Update All->).


    Figure 3. Rose Delphi Link main window

    The main RDL window is a child of the main Rational Rose window and is permanently located on top of this window and is minimized in the same way as a child window, which is undoubtedly very convenient.
    Before looking at a specific example, let's take a closer look at the Rose Delphi Link menu items.
    File -> Open Project - serves to open the created Delphi project in RDL. When you open a project, the RDL window displays the object trees of the project you are opening.
    File -> New Project - when you select this menu item, RDL offers to create an empty Delphi project. The project file created in this case contains only the declarative elements needed for a minimal Delphi program (program, begin, end). A new project should be created if the program does not contain a graphical user interface, for example, a dynamic library. However, in this case, an adjustment will need to be made to the generated code - replace program with library. Using the context menu, you can create units and additional directories for modules. Modules created in this way also contain only a minimal implementation (uses, interface, implementation, end). After creating a module, during subsequent code generation, a declaration of a new module is added to the uses section of the project file.
    The View and Help menu items are standard and do not need to be described in this article.

    Now let's use the above design methodology and develop a program and its corresponding Rose model. For example, let's take a program that fills two numeric arrays of size 5 by 5 with random numbers, and also implements some mathematical functions for processing them. The program must perform the following functions:

    • Fill arrays with random numbers ranging from 1 to 10;
    • Calculate the sum of the elements of each array;
    • Determine the arithmetic mean of elements;
    • Clear arrays (initialize them to zero).

    Let's start with developing the user interface in Delphi. As a result of simple actions with the mouse, I got the following program, which does not yet perform any actions (Fig. 4).


    Figure 4. Interface of the developed program

    Let's save this project with the default module names offered by Delphi, open a new Rational Rose project, and launch Delphi Rose Link. Let's select the Open Project menu item and open the project we just saved in Delphi. The RDL window will display the object trees of the Rose model and the Delphi project (Fig. 5).


    Figure 5. Delphi project opened in RDL

    The left object tree is the Rose model objects, the right tree is the objects declared in the Delphi source code. Notice the red exclamation marks to the left of the icons representing objects. They indicate the differences between the Delphi code and the Rose model. All icons are checked now, since the model does not exist in Rose yet.
    The next step is to generate the Rose model from the source code. To start generating, you need to click the Update All button. If the generation is successful, the exclamation marks on the objects disappear, which means that the Rose model for each object matches the Delphi source code. To view the history of generation messages, select the View -> Messages menu item. The window that opens will display a fairly detailed log of RDL messages output when generating a model or source code.
    Let's minimize Rose Delphi Link and select the Logical View branch in the Rose Object Browser. We see two packages appear:<>Unit1, which contains the object model of the code from the Unit1.pas module, and External References, which contains Delphi objects that are declared in modules outside the current project (VCL library objects).
    Now let’s open the class diagram corresponding to the Unit1 module in the Rose environment (Logical View -> Unit1 -> Overview). In its original form, the diagram shows a slightly confusing object model, which we will put in order by carefully arranging the objects according to their hierarchy (Fig. 6).


    Figure 6. Unit1 module object model

    When the interface of the program being developed is quite complex and includes more than a dozen elements, the object model becomes somewhat overloaded. In order to unload the model, you can remove some non-essential elements from the model. You only need to delete elements from the diagram, since in this case they are removed only visually. When objects are deleted from the browser, they are permanently deleted, and this entails a change in the generated RDL code.
    Now let's move on to the next step: developing an object model that implements the program functionality specified above. We will implement the classes, their attributes and methods in a separate module; in the main module we will create instances of the classes, and in the button press event handler we will write calls to the methods of these classes.

    Let's create a new module. This can be done in Delphi, and in Rose, and in RDL, but for the purity of the experiment we will create everything only in RDL. In Rose, activate the RDL window and right-click on the root element in the Rose model object tree - in our case it is Model1.mdl. In the context menu, select New -> Unit. The Component Editor window will open (Fig. 7). On the General tab, the name of the module (Unit2) and a comment for the created module are indicated, which will be inserted into the module as a comment during code generation. On the Detail tab, the type of the component and the path to the source file are indicated. On the Code Preview tab you can see the code that will be generated by RDL for this module. Turning off the Allow Code/Model Updates switch prevents code generation and model updates for the selected element.


    Figure 7. Component editor

    After clicking the Ok button, we see that an icon indicating a new module has appeared in the RDL window, and next to it there is an exclamation mark, signaling that the Rose model and the Delphi code are not synchronized. Let's update the Delphi code by clicking the Update All-> button. Now you need to switch to Delphi. We see a window warning that the module has been changed (Fig. 8). To download the updated module, click Ok.


    Figure 8. Delphi message about changing the project file

    Now let's open the newly generated module Unit2.pas. You can make sure that the code generation was successful - all the necessary keywords are declared and a comment is inserted. The next step is to model the classes and their methods in this module. Let's go to Rose and activate the RDL window. In the object tree, display a context menu on the Unit2 object and select New -> Class. The Class Editor window appears (Fig. 9). On the General tab, you need to specify the class name (Name), kind (Kind), visibility (Visibility) and comment for the class (Documentation). In our case, the class will be called TMassiv, the scope for it will be Public.


    Figure 9. Class editor

    To create all methods and attributes of a class, we will use the New menu item in the class context menu in the RDL object tree. Attribute and method editors are basically similar to the class editor, so we will omit the creation details. Let's create the following attributes and methods (all methods with Public visibility directives, the M attribute has Private visibility):
    M: array of Integer; procedure Init; // Initializing the array procedure FillMassiv; // Filling the array with random numbers procedure CalcSum; // Calculate the sum of array elements procedure CalcSr; // Calculate the average value of array elements function GetElement(X, Y: integer): Integer; // Getting an array element (x,y) We will also create a method for the TForm1 class, which will fill the TMemo components located on the form with elements from arrays:

    Procedure GetMassiv;

    There is something special about creating methods with parameters. First, the method is created in the usual way, then, in the RDL object tree, in the context menu on the method for which you are asked to specify a parameter, select New -> Parameter and specify the name of the parameter, its type and a comment for it. After creating the class, take a look at the class diagram for the Unit2 module in Rose - our class is displayed according to the UML specification (Figure 10).


    Figure 10. Class diagram with the created class

    So, the class has been created, or rather its shell, without implementation yet. Now in the main module Unit1 we will create two instances of this class. Let's declare them as M1 and M2 in the Public section of the TForm1 class. This is done by selecting the necessary items in the context menu of the object tree and specifying parameters in the attribute editor. The modified diagram, where the declared instances of the class are shown in the TForm1 class, is shown in Fig. 11.


    Figure 11. Class instances declared in the public section of the TForm1 class

    So, the model is built, and now we need to generate the final code. In the RDL window, click Refresh, Update All-> and go to the Delphi environment. Now you need to write code that implements the functionality and compile the program. When populating methods with code, you sometimes need to add local or global variables. This can be done in RDL, but it is better to implement these variables in code and then update the Rose model from the Delphi source code (Update All). If some elements have been deleted in the model, but they are already implemented in the code, this code is contained between the compiler directives ($IFDEF DELETED) and ($ENDIF). After implementing all the source code in Delphi, let's go back to the RDL and reverse engineer it again by clicking Refresh and Update All. The TForm1 class has changed - it now has methods - button event handlers (Fig. 12). In our case, this is the final version of the class diagram and the entire model as a whole.


    Figure 12. Final class diagram for Unit1

    The final source code of the program and the built Rose model are available.

    In this example, we followed the application development methodology proposed by the developer of Rose Delphi Link, and as a result we received an object model of the system. All classes and diagrams describing the system's activities were designed in Rational Rose using the Rose Delphi Link program. So, let's highlight the main advantages of using RDL and Rational Rose together:

    • quick and convenient creation of a user interface prototype;
    • the ability to obtain a detailed model of interface classes, and on its basis to highlight the fundamental architectural features of the system;
    • the ability to compare classes with functional requirements for the system;
    • the ability to create control classes in Rational Rose models with subsequent code generation in Delphi;
    • Full support for the life cycle of the developed software system when using other Rational products.

    Thus, with periodic reconciliation based on reverse engineering technology, the Rose model and Delphi code are ensured, which allows the designer to ensure that the architectural decisions have not undergone significant changes, and also to have up-to-date documented models reflecting the actual state of the project development.

    Literature:

    1. Vendrov A.M. Design of software for economic information systems. - M.: Finance and Statistics, 2000.
    2. Trofimov S.A. CASE technologies: practical work in Rational Rose - BINOM Publishing House, 2001
    3. Butch G., Rumbaugh D., Jacobson A. UML language. User's Guide: Per. from English - M.
    Share