Dynamic Data Definition

This tutorial aims to provide a detailed guide to create and manage dynamic data definitions using Software Ideas Modeler. This guide will walk you through adding data sources of various types and defining data binding, considering various specific fields based on data source types.

Dynamic data play a crucial role in enhancing the flexibility, accuracy, and relevance of modeling projects. By leveraging dynamic data, users can reflect real-world scenarios more accurately within their models, allowing for a more comprehensive analysis and better-informed decision-making.

How to Define Data Binding for a Data Souce

Step 1: Open Data Sources Sidebar

1. Navigate to the Data Source Sidebar:

  • Click the Data Source button located in the sidebar header, OR
  • Press CTRL+Q and type "Data Sources" in the quick action box.

This sidebar houses a toolbar and a Data Sources tree displaying the existing Data Sources and their respective Data Bindings.

Toolbar Options:

  • Add Data Source: To add new data sources.
  • Add Binding: For defining new data bindings.
  • Edit: Allows editing of selected data source or binding.
  • Delete: Enables deletion of chosen data source or binding.
  • Process & Process All: For processing the selected or all data sources and bindings.

Step 2: Add a Data Source

1. Click on the Add Data Source button in the toolbar.

2. A Data Source dialog appears with the following drop-down options to choose from:

  • CSV file
  • Database
  • Fixed-length columns file
  • JSON
  • Regex
  • XML
Data source type choice
Data source type choice

Step 3: Define Data Source

The Data Source Window facilitates the creation and configuration of data sources by allowing users to specify the type and associated details pertinent to the selected data source:

  • Name: Assign a name to the data source. This is a text box where you can type the name.
  • Data Source Type: It displays the selected type with an option to change it.
  • Add to Project Button: Allows the inclusion of the new data source in the project.
  • Specific Fields: Depending on the selected data source type, various specific fields will be displayed for users to input corresponding details. For instance, if the selected type is CSV, fields related to file name, encoding, delimiters, and data preview will be available.
Data source definition
Data source definition

CSV

CSV, or Comma-Separated Values, is a straightforward file format used to store tabular data, such as a spreadsheet or database. In this format, each line represents a row in the table, and the individual values (columns) in that row are separated by commas. In Software Ideas Modeler, when CSV is selected as a data source type:

  • File Name: Specify the CSV file name in the provided text box.
  • Encoding: Choose the suitable encoding type from the dropdown.
  • Value Delimiters: Select the value delimiters using the multichoice field.
  • Line Delimiters: Specify the line delimiters in the multichoice field.
  • Start & End Quote: Define the starting and ending quotes using the combo box.
  • Quote Escape: Specify the quote escape character using the combo box.
  • First Line Header: Use the checkbox to indicate whether the first line is a header.
  • Data Preview and Preview Button: View and refresh the data preview using the grid and button.

Database

The Database type allows users to connect to external databases, such as MS SQL or MySQL, and import data directly from database tables or using custom queries. This type is extensive, providing fields like:

  • Data Source: Choose between MS SQL, My SQL, OLE DB, ODBC from the dropdown.
  • Connection String: Enter the connection string in the combo box and use the ellipsis button for the connection string builder dialog.
  • Custom Query: Write a custom SQL query for specific data retrieval in the provided multiline text area.
  • Table: Select a table and preview its data using the list box and data preview grid.

JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write and easy for machines to parse and generate. When JSON is chosen:

  • File Name: Specify the JSON file name in the text box.
  • Encoding: Select the appropriate encoding type from the dropdown.
  • Data Preview and Preview Button: View and refresh the data preview using the grid and button.

Fixed-Length Columns File

This type refers to text files where each field occupies a fixed number of characters, allowing each row to be a constant length. When this type is selected:

  • File Name: Specify the file name in the text box.
  • Encoding: Choose the encoding type from the dropdown.
  • Line Delimiters: Define the line delimiters in the multichoice field.
  • Append Rest to Last Column: Use the checkbox to decide whether to append the remaining data to the last column.
  • Columns: Edit the Name and Length columns using the grid and Add and Remove buttons.
  • Data Preview and Preview Button: View and refresh the data preview using the grid and button.

Regex

This type allows users to import data using Regular Expressions (Regex), which are sequences of characters defining a search pattern. This is especially useful for extracting specific data from unstructured or semi-structured text files. Configuration fields include:

  • File Name: Specify the Regex file name in the text box.
  • Encoding: Select the suitable encoding type from the dropdown.
  • Regex: Enter the Regex pattern in the text area.
  • Process by Lines: Use the checkbox to choose to process by lines with subfield Line delimiters.
  • Data Preview and Preview Button: View and refresh the data preview using the grid and button.

XML

XML, or Extensible Markup Language, is a markup language designed to store and transport data. It is both human-readable and machine-readable. When XML is selected as a data source type:

  • File Name: Specify the XML file name in the text box.
  • Encoding: Choose the appropriate encoding type from the dropdown.
  • XML Path: Enter the XML path in the provided field.
  • Data Preview and Preview Button: View and refresh the data preview using the grid and button.

Step 4: Define Data Binding

1. Select a Data Source in the Data Sources sidebar.

2. Click the Add Binding button or use the Edit button when selecting an existing data binding.

3. A Data Binding window will appear containing controls like:

  • Name: Enter the name for the data binding.
  • Data Source: Choose a data source from the dropdown.
  • Data Transformation Type: Select the type of data transformation needed.
  • Target: Choose a specific element from the project.
  • Target Type: Select the element type e.g. UML Class, ERD Entity, etc.
  • Data Mapping: Specify data mapping between source column and target property.
  • Skip & Maximum Records Count: Define the records count to skip and the maximum records count.

Data Mapping Dialog

For some type of data binding, you may need to define a mapping between the source and the target structure. You can do it using the Data Mapping. The dialog offers these options:

  • Add - to create a new mapping
  • Remove - to delete the selected mapping
  • Clear - to remove all mappings
Data mapping
Data mapping

Data Transformation Types

Data Transformation allows users to morph the sourced data into varied formats aligning with their modeling needs. The Data Transformation Type dropdown menu unfolds multiple transformation alternatives.

Create Diagram Elements

This transformation type allows users to create elements or entities of the same type directly from the imported data. This functionality is particularly beneficial when users need to visualize structures within the data, such as creating multiple instances of UML classes, UML data types, UML packages, ERD entities, etc., based on the data provided. However, it’s crucial to note that this transformation doesn’t load or visualize the relationships between different entities or elements; it focuses on importing and representing individual entities or elements of a similar type. The created elements will be placed into a diagram defined using the Target field.

Create Model Elements

Opting for this transformation type allows users to create elements within a model, such as classes in a UML class diagram or entities in an Entity-Relationship Diagram (ERD). This transformation is integral when one needs to construct a detailed and structured representation of the data, exhibiting hierarchical structures, properties, and interactions within a model, essentially converting raw data into organized model components.

Fill Data Rows

Choosing to fill data rows means populating entities with the imported data, typically filling the rows of an ERD entity in an ER diagram with records from a CSV file or a database. This type of transformation is pivotal for users aiming to present data in a tabular format, making it a suitable choice for representing database tables or any other data that is naturally organized in rows and columns. The element into which the data from the data source will be populated is determined by the Target field.

Fill Chart Data

This transformation type is used for populating charts with the data sourced. Whether it’s a pie chart, bar graph, or any other graphical representation, this transformation will plot the data points accordingly. It is especially helpful when a visual illustration of data distributions, comparisons, or trends is necessary, enabling a more immediate and intuitive interpretation of the data patterns and anomalies. The element into which the data from the data source will be populated is determined by the Target field.

Fill Enumeration Items

When this type is selected, enumeration items in a UML diagram or a similar modeling element are populated with the incoming data. It is ideal for situations where the data represents a collection of distinct, named constants, and the user wishes to model them as enumerations, delivering a clear and concise representation of the distinct values or states available within a dataset. The element into which the data from the data source will be populated is determined by the Target field.

New Comment

Comment