MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Can I make object w/ dynamic array of sub objects
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can I make object w/ dynamic array of sub objects

 Post Reply Post Reply
Author
Message
mwpierce63 View Drop Down
Member
Member


Joined: 01.Mar.2018
Location: USA
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mwpierce63 Quote  Post ReplyReply Direct Link To This Post Topic: Can I make object w/ dynamic array of sub objects
    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
Back to Top
mwpierce63 View Drop Down
Member
Member


Joined: 01.Mar.2018
Location: USA
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mwpierce63 Quote  Post ReplyReply Direct Link To This Post Posted: 06.Jan.2019 at 16:10
Perhaps a better image representation of what I want is this:
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 06.Jan.2019 at 18:17
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
Back to Top
jpt View Drop Down
MetaCase
MetaCase
Avatar

Joined: 25.Mar.2008
Points: 239
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpt Quote  Post ReplyReply Direct Link To This Post Posted: 06.Jan.2019 at 21:15
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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.063 seconds.