Java Data Sources > Overview of Java Data Sources > What Is a Mapping in the Server/Java Integration?
 
What Is a Mapping in the Server/Java Integration?
Each object within an server model can be represented on the component side by a representation object. In the Rogue Wave Server context, the term “mapping” designates the relation between a server object and the corresponding representation object on the component side. You can refer to What Is a Mapping in the Server/Views Integration? for a full description of this mechanism. The sections that follow focus on the specifics of mapping server objects to JavaTM data sources.
All representation objects in a component derive from the class ilog.server.jcomp.RpObject. When you subclass an instance of RpObject, you need to specify how this subtype can map server objects to your RpObject objects. This is done in two steps:
1. In the static part of your representation model, you must declare your representation packages to the representation model interpreter at compile time, and implement your representation types.
2. In the dynamic part of the representation model, you must specify how the server types and server attributes are mapped to the representation types and representation attributes, respectively.
Let us take again the Network server object as an example (see Network Object Model). Its name attribute could be represented by the label attribute of a Graph representation object. When a Network object is created in the server, the corresponding Graph representation object is instantiated. And each time the name of the Network object is changed, its representation object receives a request to set its label attribute to the new value. This example can be implemented as described below.
*The static part consists in implementing the Graph as a subclass of IlsDSObject (derived from RpObject), as well as all the modifiers. By default, the expected modifier for the label attribute is the setLabel method. JavaTM components use introspection to find out and call the right modifier according to the attribute name. All attributes without such an associated method are stored in a java.util.Map named _properties with the setProperty method.
*The dynamic part consists in specifying the representation associated with the Network server object using the View Specification Language, as in the following code sample:
subscribe Network:
represent Graph rep:
string label = name;
Important: The word “property” is a reserved word and cannot be used to name attributes.
Thus, in the context of the Server/Java mapping, the implementation model that is interfaced with the representation model is a set of Server/JavaTM data sources.
The Rogue Wave Server Java Data Sources integration is a specific mapping designed to interface Rogue Wave Server with graphical objects such as Swing or Rogue Wave JViews classes through the Server/Java data sources. This specific integration offers several representation classes which interface implementation models such as lists, tables, trees, graphs, Gantt charts, or SDM objects.

Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.