Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Adam

Pages: [1]
1
Suggestions and Requests / Overrides and Implementations Dialog
« on: July 17, 2007, 09:41:06 pm »
I'm using C++, when I bring up the overrides and implementations dialog I would like to filter out all the non-virtual methods, so only those that can be overridden are displayed in the list.

This will be handy for a couple of reasons, first off if you inherit from a pretty full class (or mutliple classes or interfaces) then the list becomes shorter and easier to manage. (also the current implementation is good in that those methods already implemented are not shown in the list)

Second, it would be good to double check, in a given concrete class, "Have I implemented everything I need to implement?" you could bring up this dialog and look at what it contains to determine if you need to implement anything further.

In Addition, it would be good to somehow indicate the difference between virtual and pure virtual - in terms of what can be implemented, and what must be implemented.

I'll provide an example.


IInterface defines 2 virtual methods, bill and ted

class IInterface
{
public:
   virtual void bill() = 0;
   virtual void ted() = 0;
}

AbstractClass implements IInterface and only implements bill(), and defines one more non virtual method.

class AbstractClass : public IInterface
{
public:
   virtual void bill() { }

   void excellentAdventure() { }
}


When the Overrides and Implementations dialog is brought up on AbstractClass, only ted() is selectable.

Now, say ConcreteClass inherits from IAbstractClass. When the Overrides and Implementations dialog is brought up on ConcreteClass, you can select bill, or ted but not excellentAdventure. Since ted has never been implemented before, it should be indicated in a different way to bill (possibly coloured?), because bill already has an implementation where ted has not.


Now I know all this is C++ specific, I suppose this would need to be dependent on the language selected for the elements? maybe a tickbox on the Overrides and Implementations dialog called "show non virtual" or "hide non virtual".

Do people using other languages still use the virtual and pure attributes on operations?

2
Suggestions and Requests / Attribute containment
« on: July 10, 2007, 12:29:22 am »
I suppose this is specific to C++, but can be applied to other languages as well.

With attribute containment (parameters too), there is only a global option to select between pointer and reference, in my design I would like to use a mixture of both, depending on the use of the attribute, ownership, memory management, initialisation order etc.

Currently I cant explicitly choose one or the other, I can only say by reference or by value. To get around this now I've been using * and & to specifically say which, and not specifying a containment. This works for code generation, and is clear to read, but this prevents the attribute (or parameter) updating if the type changes.

Since I set the element type to C++ I think I should be presented with 4 types of containment:
- Not Specified
- By Value
- By Reference
- By Address (or By Pointer?)

Maybe to make this more general we want to leave the 3 types:
- Not Specified
- By Value
- By Reference

and when By Reference is selected enable a secondary propery  called nullable, or is nullable or something similar which can determine the type of reference across more languages than just c++. It will also allow some extra constraints to be specified in other languages.

The c++ solution is easy, can people think of a better, language independent way to represent this?

3
At my company we dont use the aggregation and composition connectors because they are not implemented correctly according to the UML spec. We use associations and manually set the required association properties, this has raised a few issues in 6.5 and 7.0.

Firstly, since we dont use those (and to prevent myself accidently using them) in 6.5 I was able to remove the buttons for Compose and Aggregate from my toolbox, in 7.0 alas this feature seems no more (unless I cant find it). Can we have it back? the ability to customise these new views.

Second, it would be a great time saver if the Aggregate and Compose buttons were implemented as associations, with the adornments put on automatically. (Ha! then I wouldnt need to remove them from the toolbox) For backwards compatability I suppose this could be a configuration option.

Third, a more minor one, when you show labels in the toolbox, then change diagrams then back (so the toolbox changes) the change doesnt seem to stick, not for relationships anyway.


4
Suggestions and Requests / Operation and Attribute dialogs
« on: June 27, 2007, 11:31:44 pm »
A suggestion for the operation and attribute dialogs. (Mainly focusing on operations for my example)

I think the list control should not be on the first tab. Instead the list of attributes/operations should be on the left, possibly in a tree control instead of a list control.

Then you can select a tab, and not have to switch tabs to change operations. So you might pick the second tab, you can go through each operation without going back to tab 1 (which seems to reset its scroll position) selecting the next operation, then switching back to tab 2.

Also, using a tree control rather than a list control, the width can be reduced by showing just the operation names (the return type/parameters could reside under the operation by clicking the '+' button in the tree control).

This would allow easy changing of operations without changing tabs, and without losing the current list position. Further more, re-ordering can be done without using those clunky up/down buttons (ever tried to reorder a long list?) and simply a drag/drop approach.

And more still... you could allow multiple select so that maybe you want to bulk change all your selected methods to virtual, or to return the same type.

And even more... now you dont have a list of operations on the first page, you could do away with the parameter pop up dialog, and embed parameter information directly into the main dialog.


5
Hi, I've just submitted a feature request I think would be quite useful.

Say you have one sequence diagram, and that sequence diagram has multiple diagram gates as "entry points" into that diagram, each gate triggers a certain method call, eg 1(), 2(), 3().

You then create a second sequence diagram, you drag the first onto that diagram as an interaction occurrence.

You then make a call/message to that interaction occurrence. The message drop down box is empty, you have to manually type everything in, you can leave it all blank and double click the interaction occurrence for more info, but this is omitting information off the diagram which may prove useful to the person reading the sequence diagram.

I think it should be populated with 1(), 2(), 3() (from the diagram gates on the sequence diagram), so you can select the correct entry point into the sub-sequence. Personally I usually limit the gates per sequence to 1, but I used 1-3 as an example.

Furthermore, if you choose (2) and then on the original sequence diagram you change a parameter, or the message signature changes, I think the call to the interaction occurrence should also update (to be consistent with the way this works everywhere else).

Currently due to the shortcomings I have reverted to using messages, and putting a hyperlink next to it. This doesnt really cut it because there is no way to link the hyperlink to the actual MESSAGE with a connector, it seems you can only link the hyperlink to the element.

6
General Board / Re: generate c++ generic operation
« on: September 06, 2007, 10:12:24 pm »
bump

7
General Board / Re: Problem with MDA transform double quotes
« on: August 20, 2007, 11:14:58 pm »
Ahh, but what if you are trying to replace \ with / ? for example to generate proper c++ includes...

to define a '\' character is impossible, you cannot go:
$backslash = "\"

you need to be a smartass:
$backslash = %TRIM("\ ")%

so the resulting code in my situation is:
$RSFileImports = %fileImports%
$backslash = %TRIM("\ ")%
$RSFileImports = %REPLACE($RSFileImports,$backslash,"/")%
$RSFileImports

8
General Board / Show/copy relationships
« on: April 04, 2007, 06:16:44 pm »
Is there any way to show or copy relationships specified between elements to element instances.

For example, I've got Components or Classes with relationships like dependencies or associations, I have some objects or instances of components on a diagram and I'd like to show the same relationships between them as specified on the actual components.

Is it possible?

9
Uml Process / Re: Package Structure
« on: August 23, 2007, 12:16:00 am »
Because Nodes dont allow you to generate code for elements between them, I've developed a second workaround...

1. Choose a stereotype you will use to represent a non-namespace package, apply this to all the packages you dont want to be namespaces. I used 'container'.

2. Modify the code generation templates, where the packageNamespace is 'container' dont generate the namespace. This is pretty easy, you just add another condition to the existing exclusions (like the one that checks the global option of whether to generate namespaces).

Namespace Body:
Quote
%if packagePath == "" or genOptCPPGenNamespace != "T" or packageStereotype == "container"%
%endTemplate%

namespace %packageName%


You need to do a bit more messing around to remove the namespace in the implementation file - for c++ it inserts a
Quote
using namespace::classname

You can substring it, or like I did I totally removed the using declaration, and inserted a namespace instead

Import Section Impl:
Quote
$RSFileHeaders = %fileHeaders%
$eolPos = %FIND($RSFileHeaders, "\n")%
$RSFileHeaders = "\n" + %LEFT($RSFileHeaders, $eolPos)% + "\n\n"
$RSFileHeaders


Namespace Body Impl:
Quote
%if packagePath == "" or genOptCPPGenNamespace != "T" or packageStereotype == "container"%
%list="NamespaceImpl" @separator="\n\n\n" @indent=""%
%list="ClassImpl" @separator="\n\n\n" @indent=""%
%endTemplate%
namespace %packageName%
{

%list="NamespaceImpl" @separator="\n\n\n" @indent="    "%
%list="ClassImpl" @separator="\n\n\n" @indent="    "%

}


There you go, you have non-namespace packages. There is a caveat however, it only works for forward engineering, if you decide to sync code changes back the other way, then I'm pretty sure it will relocate the classes outside the 'container' package.

For this reason I think it still needs the new 'This package isnt a namespace' feature.

Pages: [1]