A
A
Alexey2016-05-15 12:07:18
JavaScript
Alexey, 2016-05-15 12:07:18

How to show javascript class in UML?

There is a class

"use strict";
function CraneGUI(id) {
    this.htmlElement = document.getElementById(id);
    this.type = this.htmlElement.tagName;
    //if (this.type === "INPUT")
}

CraneGUI.prototype.set_value = function (value) {
    if (this.type === "INPUT")
        this.htmlElement.value = value;
};
CraneGUI.prototype.get_value = function () {
    if (this.type === "INPUT")
    return +this.htmlElement.value
};
CraneGUI.prototype.addEventListener = function (event,func) {
    this.htmlElement.addEventListener(event,func);
};

d0dfac1cf5c04d7181d8f3541506b496.png
There is also a function that initializes objects of this class, passing id as an argument to the constructor. How to show this relationship, does the UML allow partial notation, i.e. can I take this class in a vacuum, but show that an id is needed to create instances?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question