Mapping Between Business Layer and Presentation Layer |
| Applies to: yFiles 2.5, yFiles 2.4, yFiles 2.3, yFiles 2.2, yFiles 2.1, yFiles 2.0 |
Categories this article belongs to:
| yFiles for Java | > Other | ||
| yFiles for Java | > yFiles Basic | > Working With the Graph Structure | > Binding Data to Graph Elements |
| yFiles for Java | > yFiles Layout | ||
| yFiles for Java | > yFiles Viewer |
When it comes to map between these two layers, the yFiles library provides support for the direction from presentation layer to business layer by means of so-called data accessors, most prominently implementations for interfaces NodeMap
and EdgeMap
.
The concept of data accessors is explained in the yFiles Developer's Guide in
Binding Data to Graph Elements
.
Conveniently provided by class Graph are the default implementations of the aforementioned interfaces.
These can be created using the Graph.createNodeMap()
and Graph.createEdgeMap()
methods, respectively.
More information on the default implementations can be found in the yFiles Developer's Guide in the section Default Map Implementations
.
To map from an application's business layer to the presentation layer, i.e., in particular to the nodes and edges of a graph, possible solutions would be to
- use a field in the business object that holds the corresponding node or edge
- use a map implementation that does the mapping, e.g., an implementation of interface java.util.Map
| Keywords: | business - model - presentation - layer - NodeMap - EdgeMap - map - mapping - node - edge - createNodeMap - default - data - accessor |


