Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: ig on September 23, 2021, 03:38:51 pm

Title: Modeling data streams and field orders
Post by: ig on September 23, 2021, 03:38:51 pm
Hello,
I have the following modelling problem:

We have a byte stream, which I need to model; e.g. frames coming from somewhere.

The frame may look something like:
Field1 = length: 2 bytes  -> offset 0
Field2 = SequenceId: 4 bytes -> offset 2
Field 3 = SourceId: 1 byte -> offset 6
Field 4 = EncodingType: 1 byte -> offset 7


Using the names field1…field4 does not pose an issue when modelling the class, but when I change the attributes to something more meaningful then this becomes a mess.

The class will make something like this:
EncodingType: TEncodingType
Length: uint16
SequenceID: int32
SourceID: short

This does not resemble the actual structure of the stream, i.e. de order of the fields within the stream. I would like to show the sequence of fields in the right order. I understand when using classes and methods this is not that import because getSourceId() will solve my issue, but to users not familiar with this, a more conventional approach is favorable, specially when documenten the stream in an interface control document.

How do I model this in EA showing the real sequence of the fields, so preserving the order of the fields in the class. Do you model this in an class diagram or an other type of diagram?

Help is much appreciated.
Title: Re: Modeling data streams and field orders
Post by: Geert Bellekens on September 23, 2021, 04:13:08 pm
You can change the order of attributes using Ctrl+ arrow in the features window (F9)

Geert
Title: Re: Modeling data streams and field orders
Post by: Paolo F Cantoni on January 16, 2023, 03:53:35 pm
You can change the order of attributes using the Ctrl+ arrow in the features window (F9)

Geert
I tried this (as I have done over the years), and although the order changed in the dialog, the diagram and browser remained, annoyingly (and unexpectedly), in alphabetical order! This is under both v16.1 and v15.2  I have marked the [X] Free Sorting checkbox in the [Ctrl+F9] General Dialog.

What secret sauce am I missing?  Also, if I try this in the browser, the sorting arrows are disabled (as I move from the object to the attributes).

TIA,
Paolo
Title: Re: Modeling data streams and field orders
Post by: Geert Bellekens on January 16, 2023, 04:07:46 pm
I don't know what to say.

For me this works, also in v16.
The diagram updated immediately.
The project browser needed a reload to show the new attribute order.

Geert
Title: Re: Modeling data streams and field orders
Post by: Paolo F Cantoni on January 16, 2023, 07:23:58 pm
I don't know what to say.

For me, this works, also in v16.
The diagram was updated immediately.
The project browser needed a reload to show the new attribute order.

Geert
Thanks, Geert,

I'll keep looking and trying.

Paolo

[Edit: it was machine specific. Feature ordering is controlled by a second option under Preferences | Object.]
Title: Re: Modeling data streams and field orders
Post by: qwerty on January 16, 2023, 09:22:19 pm
[Edit: it was machine specific. Feature ordering is controlled by a second option under Preferences | Object.]
Only two? Keep searching for the third option!  :-X

q.