DA# Macro(1): DA#, DA# API, DA# Macro Overview

This article introduces DA#, a domestic data modeling tool, and examines API provided from DA# v5 and DA# Macro, a tool developed using it.

1. DA# Macro Overview

1.1. Data Modeling Tool DA#

DA# is a domestic software that can create and manage a data model expressed in ERD (Entity Relationship Diagram), and the developer is Encore (https://en-core.com/)to be.

DA# Homepage: https://www.en-core.com/solution/solution2

The DA# screen is as follows. This is a screen with the example model included in DA# opened.

데이터 모델링 도구 DA# 화면
Data Modeling Tool DA# screen

The main features of DA# are as follows.

데이터 모델링 도구 DA# 주요 기능
Data Modeling Tool DA# Key Features

Among the main features, there is information about API support.

DA# 주요 기능중 API 언급
DA# API mentioned among major functions

DA# provides API from v5.0 (released in 2016). For reference, ERwin and PowerDesigner, which are foreign data modeling tools, also provide APIs.

1.2. DA# API

1.2.1. Why Data Modeling Tools Need APIs

Data modeling tools are basically drawing tools that place rectangular boxes on a two-dimensional plane, fill in the contents of the boxes, and connect the boxes with lines. There is a feature that has no choice but to use the mouse more than the keyboard.

  • Productivity reasons
    • Working with a mouse is less productive than working with a keyboard. Tasks performed with a mouse are difficult to automate, requiring similar tasks to be performed manually each time. (e.g. reverse engineering, placing entities on diagrams (moving locations), batch changing entity names/property names of multiple models, etc.)
    • By making and using frequently repeated tasks as tools, you can reduce the time it takes to work, and improve quality by reducing or eliminating mistakes that anyone can make.
    • APIs provided by data modeling tools are needed to create these tools.
  • Health aspect reasons
    • Carpal Tunnel Syndrome symptoms can appear if you use the mouse a lot. In severe cases, the wrist and fingers become numb and the pain is so severe that it is impossible to do work.
    • The degree of pain felt varies greatly from person to person, but in my case, it appears severe.
    • If you want to reduce the pain even a little, you need to minimize the use of the mouse, and in this case, it is helpful to use the API of the data modeling tool.

In particular, when there are dozens to hundreds or more data model files instead of one or two, API utilization is essential when collecting information in batch or changing some information of a model.

1.2.2. DA# API Concept and Object Model

The Wikipedia definition of API (Application Programming Interface) is as follows.

API (Application Programming Interface[*], application programming interface) refers to an interface that allows an application program to control functions provided by an operating system or programming language. It mainly provides interfaces for file control, window control, image processing, and text control.

* source: https://ko.wikipedia.org/wiki/API

Simply put, an API is a way for one application to be controlled by other applications.

* Reference YouTube video: DA# 5's API and convenience features – DA# 5 launching seminar (https://www.youtube.com/watch?v=iGS7B-hJE-4)

The conceptual diagram in the DA# API manual is as follows.

DA# API 개념도
DA# API Conceptual Diagram

Below is the diagram of Application, the highest level object of DA# API.

DA# API: Application
DA# API: Application

Similar to Excel Object Model, DA# API also has the concept of Object Model.

Reference: Excel VBA Course (3): Excel Object Model

The entire Object Model of the DA# API is as follows. (This is not in the official manual, and I organized it myself.)

DA# API Object Model
DA# API Object Model

Please note the following.

  • In the figure above, the object with a dark background is a collection object.
  • Green arrows point to the same object type. Some of the objects constituting the hierarchy of the Object Model also appear below other hierarchies. (Target objects: Models, Entitys, Attributes, Relations, Tables)
  • UDPS is not provided as a member variable in the current DA# version (v5.1.0.4) at the time of this writing, but can be accessed through functions.

1.3. DA# Macro Tool Introduction

DA# Macro is a tool that can execute batch operations on data models by utilizing the API provided by DA# v5. It is implemented with Excel VBA and uses API of DA# v5.

It was developed directly to increase the productivity and quality of repetitive pattern work (Get, Set) and the most mouse-intensive work (Reverse) while performing work related to data models in several projects. I made v1.0 in April 2018, and the latest version is v2.11 on January 12, 2021.

The version history is as follows. The third item, DA# Version, means the DA# version in which the Macro of that version operates normally. (Confirmed when the version is distributed)

Date
(Version)
ContentsDA# Version
2021-08-14
(v2.12)
– Partially modified license contents for public use on Github
– Delete message at the bottom of each sheet function (Performance is greatly improved if you bring up the Modal window in DA# before clicking the button (e.g. Create New Model window))
  –> Since DA# v5.0.19.32, the performance has been improved by opening the Modal window internally during API operation, and message guidance is no longer required.
[Fix] Changed entity, property property get method from array access to individual property access (revert v1.32 change)
  – There was a problem that some property values were not brought when accessing the array, so it was restored
[Fix] Fixed a bug where property definition only gets the first property of an entity
5.0.20.2 or higher
2021-01-12
(v2.11)
[Fix] Reverse input file writable read, read all and do not close option added5.0.20.2 or higher
2021-01-12
(v2.10)
[Add] Reverse detailed function added
  – Entity group name text box added (font name, font size cannot be set)
     (The API for adding text boxes is provided for the first time in v5.0.20.2, so check the version before using it!)
5.0.20.2 or higher
2021-01-10
(v2.00)
[Add] Reverse function added: DA# model created from table definitions and column definitions written in Excel files
  – Reverse multiple models at once (DBMSType for each model, definition can be set)
  – Reverse by setting the subject area of the table and dividing it by subject area
  – By designating entity groups, they are grouped and placed in one location by group within one subject area
  – Add entity group name text box later… (Currently no textbox creation API provided)
  – UDP settings are not included in this version (included in the future if needed)
[Fix] Change the Named Range of the first row of data to Header (to prevent errors when deleting the first row)
5.0.19.32 or higher
2020-12-05
(v1.32)
[Enhance] Change the entity and property property get/set method from individual property access to array access
  – Minimum 2x to 3x performance improvement
  – Excluding some properties that are not provided by the Array approach (e.g. properties-DomainName, UDP)
[Add] ReverseTable, ReverseColumn, ReverseType, ReverseLength added to Attribute(Set)
5.0.19.32 or higher
2020-08-06
(v1.31)
[Fix] Handling line separator characters for properties that can be entered in multiple lines among entities and properties
  – Target Property: Entity-Definition, Data Processing Type, Special Item, Note, Property-Definition
  – Before change: Even if you enter entity definition in Excel in multiple rows, the result reflected in DA# comes out as one row
  – After change: Multiple rows are normally reflected
[Fix] Fix CopyToSet button error when there is only 1 row in Entity(Get), Attribute(Get) sheet
5.0.19.12 or higher
2020-03-01
(v1.30)
[Fix] Handle changed property (Model.FilePath –> Model.GetFilePath())
[Fix] specified UDPAdded error handling if is not in the model
5.0.19.12 or higher
2018-11-10
(v1.23)
[Fix] Changed Attribute (Set) to use Variant Array (not use Transpose)5.0.13.7 or later
2018-11-07
(v1.22)
[Fix] Changed from extracting entity and attribute list by subject area to extracting entity and attribute list by model
[Fix] Changed to Range.Offset approach due to Type Mismatch error when executing Transpose of Variant Array
5.0.13.7 or later
2018-09-09
(v1.21)
[Fix] Changed the method of loading the attribute list (Application.WorksheetFunction.Index –> Direct reading as Variant Array)
[Fix] Changed GetModel: If the target model is already open, handle it so that it does not open again (using Model.FilePath Property)
5.0.13.7
2018-09-04
(v1.20)
[Fix] Improved performance by changing Range.Offset(…) direct access to Variant Array
[Add] Added Get/Set item selection function
[Add] Added UDP Get/Set function
[Add] Added a function to add an open model to the list (selectable to save & close)
5.0.13.4
2018-04-14
(v1.10)
[Fix] Change access of Range value from Range.Text to Range.Value2
[Fix] Modified to skip when the Range value in Set is an invalid value such as #N/A as a result of VLOOKUP
[Fix] Adjust the order of extraction items of Attribute (Get) (change the position of table name and attribute name)
[Fix] Fixed a bug where the definition of Attribute (Set) could not be set
[Add] “Are you sure you want to continue?” when clicking the Get/Set button. confirm by message
[Add] Disable Undo/Redo to improve performance (Model.ActiveAction(False))
[Add] Apply ProgressBar to Set
[Add] Added Copy to Set button
5.0.11.8
2018-04-08
(v1.00)
Initial deployment (provides basic Entity/Attribute Get/Set functions)5.0.11.8

Eagle(Excel VBA Course (10): Tools developed and used with Excel VBA) was introduced as follows.

It is a macro tool that increases the utilization of DA#, a domestic data modeling tool. The DA# provides a great function called 'batch editing', but it is possible only in one model unit. This tool enables entity/property information retrieval (Get), modification (Set), and reverse functions to be processed for multiple models at once.

For example, if there are 100 data model files, assume that you want to change the existing name by adding a specific value (system name or business name, usage status, etc.) to the entire data model in batches before or after the managed entity name. see.


Even if you use the “batch edit” function, you have to open each data model file one by one, save, close, and repeat the next file after working on the “batch edit” screen.

If there are not many targets for this task and it is a task that is executed only once, it can be processed manually.


Also, if there are multiple data models, the reverse setting and execution of each model must be manually repetitively processed. It takes a lot of effort when you have dozens or hundreds of data models.


In this case, the DA# v5 Macro tool introduced in this article can help.

The DA# Macro execution screen is as follows.

DA# Macro: Entity(Get)
DA# Macro: Entity(Get)
DA# Macro: Entity(Set)
DA# Macro: Entity(Set)
DA# Macro: Attribute(Get)
DA# Macro: Attribute(Get)
DA# Macro: Attribute(Set)
DA# Macro: Attribute(Set)
DA# Macro: Reverse
DA# Macro: Reverse

The main functions of DA# Macro are as follows.

  • Common function
    • Select Model button: select model files (n possible)
    • Clear List button: reset the current list
  • Get Entity/Attribute
    • Get Entity/Get Attribute button: Extract information of selected models to Excel. Open selected models, extract information, close, and sequentially iterate through the next model
    • Copy to Set button: Copy the Set standard value from the current list to the Set sheet (excluding the subject area name)
  • Set Entity/Attribute
    • Set Entity/Set Attribute button: Reflects the information in the Excel list to the selected model. Selected models are opened, reflected, saved, closed, and the next model is repeated sequentially (if the value in the Excel list is empty, the corresponding property value of the DA# model is not changed)
    • Set option
      • Reference value: Reference value to compare the information of the Excel list and the DA# model
      • Append Mode: Whether to append the Excel value to the current value of the information item of the DA# model
  • Reverse
    • Create DA# model from Table, Column, FK (optional) list Excel file
      • Process multiple models and multiple subject areas at once
      • Core function: Arrangement in a diagram for each entity group within one subject area

1.4. Download DA# Macro

You can check it out in the github repository below.
https://github.com/DAToolset/DA-Macro

Alternatively, you can download directly from this URL.
https://github.com/DAToolset/DA-Macro/raw/main/DA%23%20Macro_v2.12_20210814.xlsm


So far, we have looked at the DA#, DA# API, and DA# Macro tools. Next, we will take a look at the functions of the DA# Macro.


<< List of related articles >>

Leave a Reply

Your email address will not be published. Required fields are marked *

en_USEnglish