Skip to content

Feature class

Hyemi Jeong edited this page Oct 24, 2018 · 6 revisions

InFactory has its own data structure for saving IndoorGML efficiently. "Feature Class" holds the data of the elements of IndoorGML. When InFactory creates a IndoorGML document, InFactory use JAXB. JAXB helps binding process between xml elements and Java instances.

The feature class of InFactory

The structure of IndoorGML document is hirarchical because of the association relationship between IndoorGML complex features. This structure needs to be considered when the IndoorGML document is created. But InFactory accepts the data of the IndoorGML document in any order. This is possible because of those two points :

  1. The child element can reach to the parent element by the attribute parentId new data structure The upper picture describe original hirarchical structure in IndoorGML simply. Originally there is only down-side associations at the structure. The yellow lines mean the role of parentId in this structure. parentId is used when the child element is created and there isn't the parent element yet, then InFactory creates temporal instance for this parent element by parentId firstly. Later when the parent element is created then InFactory changes the parent element's instance to the real instance. This is simple explanation of how InFactory can accept the elements regardless of the order.

  2. Every association is refered by the identifier of the refered feature, not by the real class instance.
    It works similar with the first point. If there isn't the referred feature, then InFactory creates temporal feature firstly, and later it creates the real instance of the feature.

By those points, unordered creation of the feature becomes possible in InFactory.

The implementation of the feature class

The complex features of IndoorGML are implemented as the feature classes of 'feature' module in InFactory. There are possible examples when creating the features.

More detail will be described at JavaDoc of this project

  • A CellSpace feature can be created without a State feature which has duality relationship with this feature.
  • A CellSpace feature can reach to the PrimalSpaceFeatures by parentId.
  • A CellSpace feature can have a list of CellSpaceBoundary features which are not created yet by List<String>partialboundedBy which holds the list of the CellSpaceBoundary features.

Note: InFactory only checkes whether the identifiers which the associations hold really exist when InFactory generates the IndoorGML document.

The example code of the Java class

The below code is the part of CellSpace feature class in InFactory. All the attributes related with the associations saves the identifier.

public class CellSpace{

  String id; // the identifier of this feature

  String parentId;     // the id of the PrimalSpaceFeatures feature
                       // which refers this feature as 'cellspaceMember'
  String name; // the name of this feature

  String description; // the description of this feature

  String geometry; // the id of the geometry feature
                   // (geometry2D or geometry 3D)

  List<String> partialboundedBy; // the list of the id
                                 // of the CellSpaceBoundary features

  String duality; // the id of the State feature
                  // who refers this feature as 'duality' association

  ExternalReference externalReference; // the object of
                                       // the ExternalReference
...

}

This is the detail of the attributes.

attribute type description
id string id of this instance
parentId string id of the instance which is PrimalSpaceFeature Type and refers this instance
duality string id of the instance of State Type which has duality relationship with this instance
geometry string id of the instance which hold the geometric data of this instance
partialboundedBy array of string the list of id of CellSpaceBoundary Type which is the boundary of this instance
The example code of the Java Create API function

This is the example code of creating a CellSpace feature. This code is also described at CRUD-API. The association such as partialBoundedBy is refered as a array of String. Although dualityis null at the below code, but that can be refered as the identifier of the State feature.

/*
edu.pnu.stem.dao.CellSpaceDAO.createCellSpace(IndoorGMLMap map, String parentId, String id, String name, String description, Geometry geom, String duality, List<String>partialBoundedBy)
*/
edu.pnu.stem.dao.CellSpaceDAO.createCellSpace(map, "pf1", "c1", null, null, cg1, null, partialboundedby);
Clone this wiki locally