Author Topic: Need: Category (Tagged Value Type)  (Read 7260 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Need: Category (Tagged Value Type)
« on: March 29, 2011, 01:14:04 pm »
The Enum Tagged Value Type is very useful but there are times when one needs to be able to Categorise (as opposed to Classify - by means of an Enumeration) and allow multiple values from list to be applied (similar to the distinction between RefGUID and RefGUIDList).

Can we please get a:
Type=Category;
Values=Val1,Val2,Val3;
Default=Val2;

Where more than one value in the list may be selected (and rendered comma separated).

The Default might allow:
Default=Val1,Val3;
(for example)

Reported,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #1 on: September 05, 2018, 07:44:20 am »
+1
Orthogonality rules
Using EA16.1 (1627) on Windows 11 Enterprise/64 bit. Repositories in SQLServer2019 DB Schema 1558.
WebEA on Pro Cloud Server 4.2.64

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #2 on: September 05, 2018, 09:09:23 am »
I would strongly recommend using multiple enum tagged values instead.

ie. Each one is a single value in a 0..* list.

In general it's more flexible and powerful. Even if we do need to add improved capabilities to query for multiple values in places.

As an example, I know you use shape scripts. At a guess, you're probably wanting this so a shape script can print out multiple values. But it actually means that you can't decide to convert that into decorations or similar in the future.

Using multiple tags, it would by possible to update HasTag to query on multiple values. (If it doesn't already) There's also no reason why we can't extend the syntax to get the list of values in a print (optionally specifying a separator)

Something like this:
Code: [Select]
shape main
{
  rectangle(0,0,100,100);
  print("#TAGS:category#");
}

decoration Val1
{
  if(hasTag("category","Val1"))
  {
    setfillcolor(255,0,0);
    ellipse(0,0,100,100);
  }
}
decoration Val2
{
  if(hasTag("category","Val2"))
  {
    setfillcolor(0,255,0);
    ellipse(0,0,100,100);
  }
}
decoration Val3
{
  if(hasTag("category","Val3"))
  {
    setfillcolor(0,0,255);
    ellipse(0,0,100,100);
  }
}

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #3 on: September 05, 2018, 09:51:20 am »
Actually, Simon, the problem of shapescripts didn't really come into the original request.

In our modelling, we make the clear distinction between Classification (in the Linnean sense) versus Categorisation.  We want to be able to make the same distinction with the properties (expressed as Tagged Values).  Obviously, it would be great to have support for Shapescripts, but that wasn't the main intention.

The category TV type can be the multi-selection list we users are all looking for.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #4 on: September 05, 2018, 01:18:26 pm »
My point was that multi-select tagged value types aren't a good idea. Shape scripts were just an example of how they are unsuitable.

I would recommend anyone implementing a profile away from RefGUIDList for the same reason. You can't reliably/easily determine the reverse relationship when it's a list. You can see an example of that in the traceability window. It offers the ability to show tagged value references, but it can't do that for a RefGUIDList. The performance would be an absolute killer on any non-trivial database.

Your category tagged value would suffer the same problems if you wanted to use it to drive reporting or similar.

Out of curiosity, is there a reason you are encoding a static list of categories into your categorisation instead of modeling them? These days I almost always prefer to define something in the model where possible so that it's self-documenting and easily extensible.


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #5 on: September 05, 2018, 04:57:46 pm »
[SNIP]
Out of curiosity, is there a reason you are encoding a static list of categories into your categorisation instead of modelling them? These days I almost always prefer to define something in the model where possible so that it's self-documenting and easily extensible.
Accepting that it's always best to model.  In our view (and since other users are asking for the multi-select TV, in the view of others) you may want to be able to summarise a set of relationships into a single value(1).  Also, we currently have a policy of not allowing multiple TV with the same name, it allows us to clean up the TV list when things go awry.

Accepting that with performance, "you pays your money, you takes your choice"; we are prepared to pay the money.  Since RefGUIDList is allowed, other lists should be allowed.

Paolo
(1)As you're probably aware, I'm a promoter of visualising relationships especially when hidden as properties.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #6 on: September 06, 2018, 07:55:50 am »
Paulo, you are absolutely correct that it is categorisation I am looking for.
Simon, I agree modelling both Classification and Categorisation is best.


But here's the thing you can help me with...


My scenario is that I am managing requirements.
I must be able to generate a view of the requirements model as a word document.
For example:
  • A requirement has a classification 'requirements level' (e.g. Must, Should, May)
  • A requirement has a category 'platform' (e.g. IaaS, PaaS, SaaS)
  • A requirement only has one 'requirement level', but may apply to more than one 'platform'.


In the document I must be able to display the requirement's requirement level, and the platforms the requirement applies to.
I must be able to select the contents of the document based on platform.
For example the requirement is presented in a tablular format, with columns for
  • Requirement Id (we use Alias)
  • Requirement name
  • Requirement description (Note)
  • Requirement level (?)
  • Requirement platforms (?)


Can you point me to an exemplar of how I can achieve this?

Orthogonality rules
Using EA16.1 (1627) on Windows 11 Enterprise/64 bit. Repositories in SQLServer2019 DB Schema 1558.
WebEA on Pro Cloud Server 4.2.64

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #7 on: September 06, 2018, 08:23:37 am »
My scenario is that I am managing requirements.
I must be able to generate a view of the requirements model as a word document.
For example:
  • A requirement has a classification 'requirements level' (e.g. Must, Should, May)
  • A requirement has a category 'platform' (e.g. IaaS, PaaS, SaaS)
  • A requirement only has one 'requirement level', but may apply to more than one 'platform'.
I have a similar requirement.  I've been trying to use keywords for a category but I don't seem to be able to expose the keywords in any meaningful way.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #8 on: September 06, 2018, 09:12:21 am »
I can select by a substring in Keywords to include or exclude packages and (I think) entities in the gernated document view. (See link).
You can insert the Keywords field in generated documents.
Orthogonality rules
Using EA16.1 (1627) on Windows 11 Enterprise/64 bit. Repositories in SQLServer2019 DB Schema 1558.
WebEA on Pro Cloud Server 4.2.64

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #9 on: September 06, 2018, 09:15:44 am »
I can select by a substring in Keywords to include or exclude packages and (I think) entities in the gernated document view. (See link).
You can insert the Keywords field in generated documents.

It doesn't seem to be visible from places like the specification manager.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Need: Category (Tagged Value Type)
« Reply #10 on: September 06, 2018, 11:13:08 am »
Ah, yes, I haven't been playing in that area.
Orthogonality rules
Using EA16.1 (1627) on Windows 11 Enterprise/64 bit. Repositories in SQLServer2019 DB Schema 1558.
WebEA on Pro Cloud Server 4.2.64