- How can it be implemented?
- Handling the different layers
The development in "3-tier" architecture is simplified.
What is the 3-tier?
The 3-tier architecture is designed to separate the 3 layers of an application: GUI, processes and data.
An application will include 3 independent layers:
- presentation layer,
- process layer,
- data access layer.
Specific functions (APIs in standard languages, advanced WLanguage functions) allow these 3 layers to communicate between themselves.
The reason for separating the layers is to make the layers independent in order to simplify the maintenance and future upgrades of the application (change of database system, transfer from a graphic environment to another one, ...).
This provides better security because the access to the database is allowed via the Processes layer only.
It also optimizes the teamwork and the multi-target development.
How can it be implemented?
The dialog between the different layers is performed via classes or structures that are automatically generated by WINDEV, WEBDEV and WINDEV Mobile.
1. You choose the data sources (files or queries that must be handled in 3-Tier).
The different files and queries are created in the data model editor and in the query editor.
2. WINDEV, WEBDEV and WINDEV Mobile automatically build the class diagram corresponding to the classes and structures that will be generated.To do so, in the data model editor, select "Analysis .. Generate the UML diagram corresponding to the analysis".
You also have the ability to create, in the UML editor, a class diagram corresponding to the analysis ("File .. New .. UML .. Class diagram .. Build class diagram corresponding to the analysis and queries").To do so, on the "Analysis" pane, in the "Analysis" group, expand "Generation" and select "Generate the UML diagram corresponding to the analysis".
You also have the ability to create, in the UML editor, a class diagram corresponding to the analysis:
- Click among the quick access buttons.
- In the wheel that is displayed, hover "Architecture" and click "UML". The window for creating a new element is displayed: click "Architecture" then "UML".
- The wizard for creating a UML diagram starts.
- In the wizard, select "Class diagrams (reverse analysis, 3-Tier, ...)" and go to the next step.
- Select "Build the class diagram corresponding to the database and to the queries ( 3-Tier architecture)".
- In the window that is displayed, choose the type of code to generate (procedural or object) and validate
3. The classes and structures are generated in WLanguage.
Select "Workshop .. UML modeling .. Generate the code". The sets of procedures and/or the classes are automatically generated.On the "Project" pane, in the "Other actions" group, expand "UML modeling" and select "Generate the code". The sets of procedures and/or the classes are automatically generated.
4. You can provided "added-value" by developing your own methods in these classes.
The synchronization between the classes and the diagram is performed in real-time.
You can also modify the analysis and synchronize the UML diagram with the analysis.
5. These classes or structures allow the "Process" layer and the "Presentation" layer to communicate with each other.
Handling the different layers
- For the "Data Access" tier:
The standard functions for accessing the data can be handled: read, write, queries, transactions, ...
- For the "Processes" tier:
Specific WLanguage functions can be used: FileToMemory and MemoryToFile. These functions are used to fill the members of the class from the corresponding file items (and conversely).
- For the "Presentation" tier:
The generated classes can be handled directly, no need to worry about the structure of the database.
- For the communication between layers:
Depending on the communication protocol between the 2 layers (component, Web service, HTTP, WEBDEV site, ...), the classes can be serialized in XML or in binary format (Serialize and Deserialize).
This page is also available for…
Click [Add] to post a comment