skip to main content
Programmer's documentation > Developing with the JViews Gantt SDK > Introducing the main classes > Data model classes
 
Data model classes
Describes the abstract data model, and the concrete implementations that make up the scheduling model.
*The interaction between abstract and concrete elements
*Explains the interaction between the main interfaces in the data model and the implementation classes supplied for them.
*Using the abstract implementation to create a custom data model
*Explains where to find information about how to create a custom data model using the abstract implementation as a starting point.
*Concrete data model implementations
*Describes the data model implementations provided by JViews Gantt.
The interaction between abstract and concrete elements
The data model is completely abstract and is defined by the IlvGanttModel interface. This interface acts as an intelligent container for four other abstract interfaces that represent the scheduling data itself: IlvActivity, IlvConstraint, IlvResource, and IlvReservation. These interfaces are included in the ilog.views.gantt.
The following table gives a brief description of each interface.
Data Model Interface
Description
Defines the overall JViews Gantt data model and is a container for the other four entities.
Represents an activity or task that must be completed in the schedule.
Represents a resource that can be allocated to an activity to enable its completion.
Represents an activity-to-activity scheduling constraint.
Represents the allocation of a resource to an activity.
The following figure shows the associations between the five interfaces that compose the JViews Gantt data model.
Several levels of implementation are available for each of these abstract interfaces.
*Using the abstract implementation to create a custom data model
*Concrete data model implementations
The following tables summarize implementation classes supplied for the data model interfaces described in the previous table.
Abstract Implementation
Simple Memory-Based Implementation
Default Memory-Based Implementation
Abstract Implementation
Swing TableModel Implementation
JDBC™ Implementation
In general, there are no hard-coded dependencies between the data model implementation classes. This means that you can choose to use as much of the provided data models as you need while subclassing just the portion that you need to customize for your application.
The notable exceptions are:
*The class IlvTableGanttModel that you can use to connect to Swing TableModel instances.
See Connecting to Swing TableModel instances for details.
*The class IlvJDBCGanttModel that you can use to connect to a database.
See Connecting to data through JDBC for details.
These data model implementations require that their data entities be instances of IlvTableActivity, IlvTableResource, IlvTableConstraint, or IlvTableReservation. The IlvTableGanttModel and IlvJDBCGanttModel classes automatically create these data instances for you from the contents of the Swing or database tables. Therefore, you do not need to be concerned with explicitly populating an IlvTableGanttModel or IlvJDBCGanttModel object.
Using the abstract implementation to create a custom data model
An abstract implementation is provided as a starting point for your own custom data model designs. These classes provide the basic event notification framework, but no property or data storage.
You can create your own custom data model in its entirety, but you are recommended to use the abstract classes as a starting point. How to extend the abstract classes for this purpose is an advanced topic not covered in this documentation.
This topic is demonstrated in the database examples available in:
*<installdir>/jviews-gantt/samples/databaseGantt
*<installdir>/jviews-gantt/samples/databaseSchedule
The abstract implementations are included in the ilog.views.gantt.model.
Concrete data model implementations
Describes the concrete data model implementations provided by JViews Gantt. How to extend them is an advanced topic not covered in this section. See Customizing Gantt charts for a customization example.
Simple data model implementation
This concrete implementation is completely memory-based and provides the most basic implementation of the Gantt data model. Only the required properties of each data model entity are supported. This implementation is used as the basis for the Default Memory-Based data model described in Default data model implementation. It can also be used as a more complete foundation for your own custom data model extensions. The simple data model implementation is included in the ilog.views.gantt.model.
The following table shows the corresponding data model interfaces and implementation classes.
Data Model Interface
Simple Memory-Based Implementation
Default data model implementation
The default data-model implementation extends the Simple Data Model implementation and is also completely memory-based. This implementation inherits the required properties of each data model entity and adds support for user-defined properties. It is used throughout the examples, except for the Database example.
The following table shows the corresponding data model interfaces and implementation classes.
Data Model Interface
Default Memory-Based Implementation
See the ilog.views.gantt.model.general.
Connection to a JDBC database
The IlvJDBCGanttModel implementation of the IlvGanttModel interface connects to a database through JDBC™ to get the definition of the activities, resources, constraints, and reservations with simple mapping configuration. It is documented in Connecting to data through JDBC. See also the ilog.views.gantt.model.jdbc.
Connection to a Swing TableModel
This data model implementation enables you to create your custom data model from Swing TableModel instances. It is documented in Connecting to Swing TableModel instances. See also the ilog.views.gantt.model.table.
The following table shows the corresponding data model interfaces and implementation classes.
Data Model Interface
Swing TableModel Implementation

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