Kirk Evans Blog

.NET From a Markup Perspective

Visio - Abstract Method

@kaevans

Visio - Abstract Method

  • Comments 8
This is definitely a glaring case of RTFM syndrome, but I hadn't found how to create abstract methods in Visio's UML Sequence Diagram template.  Classes in Visio have an IsAbstract checkbox to indicate if the class is abstract, but there is no "IsAbstract" checkbox for methods.  For others who haven't discovered the less-than-obvious setting and hadn't bothered to read the help file yet (quoted from the Visio help file):
  1. In the UML Model Explorer, right-click a package icon, point to New, and then click Class.
  2. In the UML Class Properties dialog box, type a name for the class, and then click the IsAbstract check box.
  3. Under Categories, click Operations, click New, and then click the Methods button.
  4. In the UML Method Properties dialog box, clear the Has method check box, and then click OK.
  5. In the UML Class Properties dialog box, click the Properties button, set any of the options in the UML Operations Properties dialog box, and then click OK.
    Note: The IsPolymorphic check box is selected by default.
  6. In the UML Class Properties dialog box, click OK.

<Kirk />

  • Abstract methods in Visio : Jeff Key's .net blog
  • Jeff Key's .net blog
  • Good tip. You can also use this to specify an override in a sub class. You can even enter the method body. But there are two other constructs I can't get working: marking classes and methods as internal, and indicating that a constructor should call a base class constructor. Like this:

    class Foo {
    public Foo() {}
    }

    class Bar : Foo {
    public Foo () : base () {}
    }

    Any idea how you achieve either of these?
  • I honestly don't think that the construct of constructor chaining is supported by Visio. I tried reverse engineering the same class you posted, but Visio didn't catch the ctor chain. Specifying this in the method body produces the following generated code for Foo:

    public Bar()
    {
    : foo
    }

    Of course, that isn't the correct syntax... I wager that ctor chaining is not a supported construct.

    --Kirk
  • That's how it looks, yeah. Any idea on marking classes and/or operations as internal and decorating them with attributes?
  • Hi,

    I am trying to find out how to view the operations properties in status window in visio tool, without having to open the property dialog box. I am trying to do this from the uml navigator.

    I am putting the question here as this is the only discussion thread I could find that probably has some similarity to my issue.
  • I'm going nuts trying to override a method in my UML document. I reversed engineered a simple 2-class project and the override works fine. But when I try a new UML document and add a polymorphic operation I cannot find how to override it in an inheriting class? can you help? Wow thanks if so.
  • PingBack from http://rubenlaguna.com/wp/2009/03/31/adding-c-virtual-methods-in-visio/

Page 1 of 1 (8 items)
Leave a Comment
  • Please add 5 and 1 and type the answer here:
  • Post
Translate This Page
Search
Archive
Archives