Design of the Travel Impressions model in spirals

We will start the project by designing a domain model in spirals (see the model directory in the project); this is step one in our schema. This new project will allow readers to follow our approach in order to make their development of a first web application with dartling easier. The project will evolve, but in a way that reflects the usual project progression with dartling.

Note

The project can be found at https://github.com/dzenanr/travel_impressions.

The domain of the new project is Travel. The principal model of the Travel domain is called Impressions. The objective is to create a web application that will allow young travelers to inform their families and friends about their impressions of the visited places without losing too much time. With the help from someone in the family or from a friend, their impressions of the visited places may be enriched by web links. Even a traveler may send only an e-mail message about the impressions of visiting certain places to a friend, and the friend may use the web application to present impressions about the visited places expressed in the message to other interested people in a more informative and pleasing way. Of course, the traveler can do all of this without help from other people. The first spiral (refer to the Travel Impressions model figure) starts with the most important concepts from the chosen domain. In our Travel domain, the key concepts are Traveler, Place, and Impression.

In general, a traveler visits many different places and may have an impression (or more than one) for each place. A place is something of interest for a traveler. It may be as general as a city, or as specific as a monument in a city. It may also be a village or a nature spot. The important thing is that a traveler has impressions about visited places to share with family and friends.

Design of the Travel Impressions model in spirals

Spiral 1 of the Travel Impressions model

The first cut domain model is created in model concepts. There are three concepts and two relationships in the model. Each relationship has two directions. The direction from the Traveler concept to the Impression concept is also a neighbor of the Traveler concept. Thus, the Traveler concept has two attributes and one neighbor (attributes and neighbors are properties). The attributes are firstName and lastName, and the neighbor is impressions. As in Dart, the names of the concepts and properties are standardized. Since the concept corresponds to a class, its name starts with a capital letter. An attribute name starts with a small letter and, if a name is composed of several subnames, each subname starts with a capital letter. Spaces, hyphens, or underscores are not used in names. Since a neighbor is a relationship property, its name also starts with a small letter. The meaning of the impression's neighbor for the Traveler concept is expressed in the following way: a traveler may have 0 to N impressions. In the opposite direction, an impression has at least one and at the most one traveler, so it turns to be exactly one traveler. Similarly, a place may be mentioned in many impressions and an impression is about exactly one place. The Impression concept is an intersection concept between the Traveler and Place concepts. This means that a relationship between the Traveler and Place concepts is many-to-many. A traveler may refer to many places in his or her impressions, and a place may be noted by many travelers. There are two entry concepts that allow a user to navigate through the model's data, starting with travelers or places. The two concepts have the || entry sign in the left section of their title areas.

The relationship between the Traveler and Impression concepts is internal. The relationship between the Place and Impression concepts is external, which is indicated by a lighter line. A concept with more than one parent must have only one internal relationship. This means that impressions may be saved within their traveler and not within the same place. By introducing internal and external relationships, the choice of which is rather subjective, a model may be decomposed into hierarchical submodels by starting with entry concepts and following internal relationships.

What happens if a traveler sends a rather long e-mail message to his family and if he describes more than one place in the same message? This common situation is introduced in a new spiral of the model with some improvements with respect to the previous spiral. In the spiral approach, each design or development iteration brings more clarifications and more details. If the reasoning behind the spirals is recorded in the documentation of the model, it would be easy for newcomers to get familiar with the model in a step-by­step fashion.

Design of the Travel Impressions model in spirals

Spiral 2 of the Travel Impressions model

There is a new concept representing a message with the impressions of the visited places. Traveler may send many messages on his or her trip. A Message may contain impressions about several visited places. A traveler would send an e-mail and someone from a circle of family and friends would enter specific impressions about the visited places by extracting portions of the message text. A Traveler must have an e-mail attribute (as is the case with names, indicated by bold). A message must have a date when it is sent, a subject of the message, and a full text of the message. An impression's text, the country, and the name of a place are mandatory. The identifier (ID) of the Traveler concept is its e-mail (indicated by italics). The identifier of the Place concept consists of the country and name attributes. This means that each place name must be unique within its country. An impression is identified by its source message and the place about which the impression is formed (IDs of neighbors). Thus, the identifier of the Impression concept is composed of two neighbors. A message is identified by the traveler that sent the message and by the date when the message was sent. Further analysis leads to the model in the following figure:

Design of the Travel Impressions model in spirals

Spiral 3 of the Travel Impressions model

A place must be located in a specific country. Often, a visited place will be in a city. However, there are many interesting places that are not located in cities. A short description may be entered about a new place. Web links that are relevant to the visited place may be added. If we want to allow a traveler's friend to help the traveler by entering some data about her trip, the following concept should be added to the model (refer to the following figure):

Design of the Travel Impressions model in spirals

Spiral 4 of the Travel Impressions model

This concept represents a many-to-many relationship between travelers (real and virtual). In addition, there is a small change in the Message concept. The text attribute is now optional, allowing a traveler with update rights to use text only in the Impression concept. The model could be further extended with more concepts, attributes, and relationships. It is a good practice to spend more time on the model by introducing additional spirals. The new spirals may clarify some issues and provide new ideas. However, it is also a good practice to start programming with a less ambitious model, but with the knowledge of a richer model.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.189.199