Can I make object w/ dynamic array of sub objects |
Post Reply |
Author | |
mwpierce63
Member Joined: 01.Mar.2018 Location: USA Points: 2 |
Post Options
Thanks(0)
Posted: 06.Jan.2019 at 05:09 |
Hello,
I'm playing around with a DSM for creating tables of field definitions for configuring a proprietary security part. Part of the DSM would have a partition table that specifies contiguous chunks of memory which have similar properties. This table needs to be dynamically sizeable from 1 to N partition definition entries and then each of these partition entries would be related to a separate field definition object which defines the fields in the associated partition; the field definitions would each have a field name and number of bits for that field. For this example I think I need two objects: a partition map object with 1..N entries (one for each parititon) and a field list object which contains a list of field names and their sizes and which is associated with one entry in the partition map object. An example graph might look like: |------------------------------| |-------------------| | Partition 0 | properties |<-------------| Field a | 4 bits | |------------------------------| | Field b | 3 bits | | ... | | |-------------------| |----------------|-------------| |------------------------------| |-------------------| | Partition N | |<-------------| Field x |12 bits | |------------------------------| | Field z |3 bits | |-------------------| Basically I want to define an object that has as a property an editable list of objects, one object having an editable list of parition definitions and another object having an editable list of field definitions. Is that possible? Thanks, Mathew Pierce
|
|
mwpierce63
Member Joined: 01.Mar.2018 Location: USA Points: 2 |
Post Options
Thanks(0)
|
Perhaps a better image representation of what I want is this:
|
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Post Options
Thanks(0)
|
Hi Mathew,
Sure, you can use a Template to make a dynamic symbol for the Partition map object type. See the Port examples project for many ways to use dynamic symbols. https://www.metacase.com/mwb/DynamicSymbolVisualization.html |
|
jpt
MetaCase Joined: 25.Mar.2008 Points: 239 |
Post Options
Thanks(0)
|
Hi Mathew, Yes it is possible. Shortly: the binding would also contain as a port the 'Partition' ObjectType. For the notation, the symbol of PartitionTable would have a template showing invididual Partition objects as subobjects. A longer answer following the example you provided: there would be something like: 1) ’PartitionTable’ ObjectType which has a PropertyType (e.g. ’Partitions’). This property would contain a collection of ’Partition’ ObjectType which has PropertyTypes ’Name’ and ’RW’. 2) Similarly there would be ’FieldTable’ ObjectType with a PropertyType ’Fields’. This property would contain a collection of ’Field’ ObjectType having two PropertyTypes: ’Name’ and ’Number of bits’. If the number of bits value would have some restrictions the property could have regular expression as a constraint. 3) To have a connection from 'FieldTable' to a partition in a 'PartitionTable', a binding would refer to 'PartitionTable' ObjectType and to 'Partition' ObjectType in Ports setting. See a screenshot below showing this binding. Below is also a graphical GOPPRR illustrating the complete metamodel. 4) For the notation part, the symbol of ’PartitionTable’ should provide a template for partitions. In the tempalate definition for the 'Partition' choose ’Use the subjobjects as ports’ as then connections can be made to individual partitions of a partition table. The video link provided above and manual provides more details on the symbol definition. When making the relationship MetaEdit+ would then highlight the individual partitions as illustrated below. There can be also additional constraints and MERL scripts applied that checks that other possbile rules are followed correctly. Edited by jpt - 07.Jan.2019 at 08:08 |
|
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |