archi icon indicating copy to clipboard operation
archi copied to clipboard

[Feature request] Create a viewpoint

Open foxfoox opened this issue 2 years ago • 16 comments

There are many viewpoints that can exist so if there is a mechanism that enables a custom view to be created. I've seen a glimpse of the source code like Viewpoint, IViewpoint, ViewpointAction, and there is a nice structure in Archi that makes it flexible. I'm a programmer in Java and maybe I can work with you, it's a great feature to add.

foxfoox avatar Apr 11 '22 10:04 foxfoox

The main issue around this is where to store the Viewpoint definition. To be portable, it has to be stored somehow inside the model file. But it also needs to be stored somewhere outside the model so it can be re-used.

Phillipus avatar Apr 11 '22 10:04 Phillipus

What do you suggest solutions?

foxfoox avatar Apr 11 '22 10:04 foxfoox

What do you suggest solutions?

I don't have any solutions yet, that's why I haven't implemented it. This feature is low priority so I won't be thinking about it at the moment.

Phillipus avatar Apr 11 '22 10:04 Phillipus

Viewpoints are parts of AD (architecture description) and can be in the model file (it is rational). For export to other models they may be separate files with the same syntax (XML). I don't read the code clearly but I think there is a way. This feature will make a small change but the great ability will be enabled. I can involve in enabling this feature.

foxfoox avatar Apr 11 '22 10:04 foxfoox

You can create custom Viewpoints now by editing the viewpoints.xml file. You can share that file with others if you want to.

Phillipus avatar Apr 11 '22 10:04 Phillipus

Hi,

My 2cts on this:

  • As said by Phil, viewpoints definitions must be local to the model.
  • A viewpoint is more than just a restriction on concepts and involves also describing the intent of the viewpoint, the target audience, guidelines...

This means that implementing customizable viewpoints in Archi is a really big topic.

In the meantime, there's a trick I use to customize viewpoints: I create a lang plugin which sole purpose is to replace the viewpoints.xml file (discussed a bit in this issue). I even created an automated way to create such plugins using a model as input and a jArchi script. I plan to enhance it and share it someday (need some work, so not for the near future).

jbsarrodie avatar Apr 11 '22 15:04 jbsarrodie

Yes, It is not just restrictions on concepts but Modeling tools such as Archi, it is concerned about how the modeling will be for the intended purpose. Other things shall be described elsewhere outside the Archi.

foxfoox avatar Apr 17 '22 10:04 foxfoox

Another thing, I tried to add relationships in the viewpoint but it did not work. Is it allowable to be within viewpoint tags?.

foxfoox avatar Apr 17 '22 10:04 foxfoox

Another thing, I tried to add relationships in the viewpoint but it did not work. Is it allowable to be within viewpoint tags?.

No. At the moment, all relationships are allowed in every Viewpoint. Maybe we'll change that one day,

Phillipus avatar Apr 17 '22 11:04 Phillipus

You can create custom Viewpoints now by editing the viewpoints.xml file. You can share that file with others if you want to.

Could it be solved as following:

  1. Create singleton ViewPointsStorage object.
  2. Basic init of this object is done from viewpoints.xml within basic distro,\
  3. Model can store viewpoint definition as extension of certain object of viewpoints.xml .
  4. Viewpoints could be copied within single instance of Archi between models.

Also maybe in this solution there could be done custom concept definitions inside a viewpiont definition, as proposed at 42010.

WatchTh1 avatar Apr 20 '22 12:04 WatchTh1

Hi,

Reacting on #942

Some companies don't allow modifying the program files, of which the viewpoints.xml. Might be interesting to allow user defined viewpoints, defined in a viewpoints.xml stored in user files.

There's a better way to modify this file without admin right: launch Archi with a custom language (even one which doesn't exist, such as custom) and create a translation plugin for this language containing only a custom version of the viewpoint.xml file.

That's what I'm doing for my colleagues and it works just fine. I even setup a method for that: I document my viewpoints in a model, then a script generate the plugin based on the model and some metadata.

jbsarrodie avatar Jun 15 '23 16:06 jbsarrodie

Hello! I have been working on a viewpoints importer using an XML file, which is then saved into a viewpoint_custom.xml within the tool. With this, it is possible to share the viewpoint, and furthermore, it is also stored within the tool. Is this something that could be considered for inclusion in Archi?

screenshot

guillermofuentesuclm avatar Nov 16 '23 09:11 guillermofuentesuclm

Is this something that could be considered for inclusion in Archi?

It depends on how it has been implemented, but yes, this is the kind of feature that could be added. (Btw, there's some way to import viewpoints using a translation/localization plugin).

Could you share the code somewhere ?

jbsarrodie avatar Nov 16 '23 12:11 jbsarrodie

It depends on how it has been implemented, but yes, this is the kind of feature that could be added. (Btw, there's some way to import viewpoints using a translation/localization plugin).

I follow the same basic structure for the viewpoints as Archi, so their names could be translated. Here's an example:

 <viewpoint id="test">
    <name xml:lang="en">Test</name>
    <concept>Location</concept>
    <concept>Grouping</concept>
</viewpoint>

Could you share the code somewhere ?

Yes, of course, you can check it here. This is a first version of the development, and I'm willing to refactor and improve it in order to incorporate the feature

guillermofuentesuclm avatar Nov 16 '23 13:11 guillermofuentesuclm

Could you share the code somewhere ?

What do you think about code?

guillermofuentesuclm avatar Nov 27 '23 08:11 guillermofuentesuclm

Could you share the code somewhere ?

What do you think about code?

Thanks for sharing. I need more time to think about how best to implement this.

Phillipus avatar Nov 27 '23 09:11 Phillipus