ModelMaker 11

Delphi XE support

Delphi XE IDE integration is supported similar to previous Delphi IDEs. The installer includes the Delphi XE integration add-in.

Visual Studio 2010 support

  • Visual Studio 2010 IDE integration supported through IDE Integration Pack update v200

C# 4 syntax support

  • Support for the optional parameters. Default values available in (integrated) Parameter Wizard.
  • co- and contra variance support.
  • Other new C#4 syntax supported without changes.

Unicode Support

  • Model engine and GUI support unicode.
  • Models are stored as UTF8.
  • Module source files can be generated as UTF8, UCS2 or Ansi (define per module).

Pascal: Improved Method Code Layout support

ModelMaker 11 is able to create/regenerate most method implementation code layouts. Unlike previous versions, ModelMaker 11 supports code at column 1 and allows local variables to be declared after local procedures etc. See below.

Pascal Method Editor

Note how:

  • The local var section is inserted after LocalProcedure at column 1
  • the const section at column 1
  • In the main body, the conditional define {$IFOPT D+} and the comments appear at column 1

Pascal: Flat Method Code Editor

The ModelMaker 11 Method Implementation Editor edits the entire method implementation in a single block of text. Method Sections (user and/or non-user owned) internally still exist but are expanded when viewing or editing the method.

Flat Method Editor

In most cases non-user owned code sections (like property access method and "inherited call" sections) are auto converted to user-code whenever the code is modified and saved. Where this is not possible (like with certain pattern related sections) the section is displayed with a special region marker This region has to be treated as read-only. The picture above shows a non-user section owned by the Singleton pattern.

Related to this: the Property Dialog now uses customizable Code Snippets (like the C# version) to insert access code and the predefined hard-coded options have been removed. This allows more flexibility when creating property access code.

Nested Type support

ModelMaker 11 supports nested types like nested classes, interfaces, enums and other types like aliases. Nested classes, interfaces, records/structs and nested delegates are modeled just like other classes and delegates. Nested Classes and Delegates are either imported or manually added through the Members View Add pop up sub menu.

A Nested Type entity is used to encapsulate all other (non-class) nested types like enums and Pascal aliases. This entity is basically a text blob containing the type declaration code as found in a source file. The importer inserts and maintains these entities. The code generator emits them as imported, possible decorated with attributes and documentation. In the GUI these entities are read-only. Only Delete, Copy, Paste and Change Visibility are supported (Members View). The Nested Type entity supports adding a Stereotype, Documentation, a One-Liner and Attributes.

Modeled type references should use qualified names as in ContainingClass.NestedClass. This applies to ancestors, supported interfaces and member (return) types. Auto-maintained code model references (ancestor, member type etc.) do enforce this.

type
  SampleClass = class(ContainingClass.NestedClass, ContainingClass.NestedInterface)
  private
    FField: ContainingClass.NestedClass;
    function SomeMethod(): ContainingClass.NestedClass;
  end;

Difference View handles analyzes nested types rather than reducing them to module code as previously.

IDE Add-ins support nested types in the Locate in IDE and Locate in ModelMaker commands.

Nested Types in Classes view

  • Nested classes appear in the classes view just like normal classes. They are displayed with a qualified name in all ordering modes except order by containment.
  • A classes view ordering mode Order by containment is available. This is similar to Order by Name, but shows class containment as tree.
  • Selecting a nested class in classes view shows its members in Members view.
  • Copy/Pasting a nested class in classes view creates a new, unnested class. Note: use Copy/Paste in Members View to paste as a new nested class.
  • Refresh Import is not available for nested classes.
  • Pascal: option insert forward declaration option is not available and ignored during code generation for nested classes.

Nested Types in Members view

  • Nested types appear in the Members View as part of the containing class.
  • Show Classes and Show Other Types filters allow controlling display of nested types. Available from tool bar and pop up menu.
  • Go to class (shortcut Enter) extended to select a nested class in the classes view, not only the (return) class types of members.
  • The Add pop up sub menu allows adding new nested classes, interfaces, records/structs and delegates.
  • The Class Info Bar optionally shows the containing class for nested classes, allowing to navigate to the containing class.
  • Similar, Show Related Classes shows the containing class for nested classes.
  • Nested Delegates can be dragged to other classes or the containing class to create events or event handlers based on the dragged delegate signature.
  • Change Visibility, Rearrange mode and Custom ordering work as expected with nested types
  • Member Manipulator does not operate on nested types
  • Nested classes and delegates can be renamed in Members view. Nested Type entities (like enums) are read-only.
  • Copy/Paste works with nested types. Copying a nested class and pasting it in the members view, inserts a new nested class.
  • Class Templates can contain nested types: both when creating a Class Template and when applying a Class Template. Note: ModelMaker Code Explorer recognizes simple nested types like delegates in Class Templates, but will not load nested classes.

Nested Types in Diagram Editor

  • Nested classes are displayed as normal class symbols but with a qualified name as in ContainingClass.NestedClass
  • An auto maintained types compartment is displayed in class symbols. The Class Symbol "Symbol Style" tab (and similar tabs in Diagram / Project Options) has a Show Classes and Show Other Types filter that allows controlling which nested types are displayed. The custom member list styles do not allow displaying auto maintained nested types.

Stereotype based auto coloring

The Stereotype Manager (main menu Options | Stereotype) allows defining a color for each Stereotype. Diagram symbols use this color if no custom color is assigned. Class symbol member compartments also use stereotype based colors.

Stereotype based coloring is commonly used to easily spot different archetypes of classes. Check for example Wikipedia for UML Colors

Stereotype base colors

The Standard Stereotypes have been merged with the Stereotype manager view and allow defining default colored Stereotypes.

Generic changes

  • C#: New Methods optionally have a default code snippet. Typically used to insert a Todo comment or throw a NotImplemented exception. Defined in Project Options | Coding Style | New Methods | Default Code.
  • The Interface Wizard allows disabling inserting Todo items in new methods. Option added to interface wizard window.
  • Pascal: in Win32 mode class constructors naming and visibility restrictions are in line with syntax, also, class destructors are supported.
  • Delegates now support a Stereotype like other model entities. Documentation view tracks Delegates.
  • Browse Members and Browse Methods that existed up to MM 9.x have been restored. These utilities allow searching members in the entire model and maintain the matches in a list that can be used to navigate. Available from the main Tools Menu
  • Property access method Code snippets can use a new macro "GenericTypeParams". This will expand to the property's type, type parameters. For example:
    Property type = List<Document>
    GenericTypeParams expands to "<Document>" (omit quotes)
  • Module Code View allows Pinning a module. Pinned modules are opened in a new tab and decouple module code editing form the selection in Modules View.

    Pinned Modules

  • Throughout the GUI "Category" has been renamed to "Stereotype" to be in line with UML terminology.
  • Classes view: in Order by Stereotype, drag-drop classes on a Stereotype node to change the classes Stereotype.

Diagrams changes

The Diagram Editor supports Pinning Diagrams. A tab is added for each pinned diagram. The tab acts as shortcut for selecting the diagram.

Pinned Diagrams

Note: unlike pinning in the Method Implementation View, pinning does not decouple the diagram editor from the selection in the Diagram Explorer. This gives a more natural behaviour.

  • Annotations can have captions and Stereotypes and allow hyper-linking like other symbols.
  • Suggested instance names for Generic (nested) classes - as for example used on sequence, communication and object diagrams, are improved.

Code Generation changes

  • Documentation is optionally only word wrapped at spaces. Option Project Options | Source Documentation | Documentation Generation | Word wrap on spaces only
  • The macros <!Category!> <!IntfCategory!> and <!ImplCategory!> that can be re-defined to customize emitting stereotypes in code, have been replaced with <!Stereotype!> <!IntfStereotype!> and <!ImplStereotype!> respectively. The old macros are still available for backward compatibility. Also, the default text used to emit a stereotype has been changed from
    {<<Category>>: <!Stereotype!>} // old style
    {<<stereotype>>: <!Stereotype!>} // new style
    To restore the previous style, define a (project) macro named IntfStereotype and or ImplStereotype containing the previous style text.

Code Import changes

  • Refresh importing a Module or class(es) in a module uses a more precise class matching algorithm. It for example handles (auto) qualified class names and will not mix up identical named classes from a different module. Also, when an existing class is not found in the source file, it offers a manual match to a renamed class (if any) or to delete it from the model.
    Manual Class Import Matching
  • The member type and visibility filters have been removed from the Import dialog. These were previously used to import only a limited set of members for place holder classes. Import (and Refresh Import) now implicitly import entire classes only as non-placeholder. Use a Source Reference for cases where you need a limited set of members for placeholder classes.

Documentation view

  • Documentation view now tracks the focused entity from all other views. This includes delegates in modules view and nested types in members view.
  • The Check Completeness view handles nested types and recursively checks the currently focused entity for being documented.
  • The default Documentation template for Nested Type entities can be customized by adding a documentation template "Default_Template.OtherType" in the "system" templates folder. To do this, click the Documentation templates button and from the drop down menu select "Edit Documentation Templates".

ToolsAPI

The MM ToolsAPI has been reworked to deal with nested types and reflect generalization of the code model. Several properties previously only available in IMMMember are now available for IMMModelPart. Several interface parameters in method calls have been changed to "const"

  • ToolsAPI updated to v12. All add-ins need to be recompiled.
  • IMMModelPart: Parent/Children gives access to (nested) containment. Children/ChildCount Replaces IMMClassifier.Members/MemberCount.
  • IMMModelPart.FindChild/FindChildOnID replace IMMClassifier FindMember
  • IMMModelPart.RootClassifier gives access to top level containing classifier (if any). IMMModelPart.NamePath gives the period separated name path for all entities.
  • IMMModelPart.CodeItemKind enumerate replaces both IMMMember.MemberType and IMMClassifier.ClassifierKind
  • IMMModelPart introduces CustomOrder and Visibility that were previously only available to IMMMember
  • IMMModelPart.Category renamed to Stereotype
  • Delegates (IMMDelegate) are accessed via the IMMCodeModel rather than via a separate MMToolsServices.MMDelegateManager (which has been removed). Delegates can be contained either by a class (IMMDelegate.IsNestedType = True) or the global model namespace (default).
  • IMMDelegate and IMMClassifier both descend from IMMTypeEntity. IMMTypeEntity.IsNestedType: Boolean returns true if a class or delegate are nested types.
  • IMMNestedType added. This encapsulates all nested types other than classes and delegates. BaseType: TCodeItemKind and Code give the details (including name).
  • TLinkableEntity enumerate (nttClass..nttDiagram) as used to link entities in references and messages has been replaced with TEntityType (tyNone, tyClass..tyDiagram)
  • IMMNavigator.CurMember is of type IMMModelPart (rather than IMMMember). In case of nested classes, CurMember can be any IMMModelPart.
  • IMMNavigator.GetSelectedMembers potentially returns a list of IMMModelPart not just IMMMember
  • IMMMethod gives access to Section Indent Level
  • IMMModule gives access to TextEncoding
  • IMMCategoryManager renamed to IMMStereotypeManager, methods accessing categories renamed to stereotype. Added access to stereotype colors. IMMToolServices.StereotypeManager is also renamed.

Solved problems

  • Pascal: using fields and method resolution clauses in a custom class interface order could result in an uncompilable class interface due to a missing visibility specifier. Solved.
  • ToolsAPI: IMMModule.AddToUseClause would generate a catastrophic failure. Solved.
  • Syntax Editor: Unindent text could cause an AV. Solved.
  • Pasting a class in a new model, could cause an unselectable ancestor placeholder class. Solved.

ModelMaker 11.02 Service update

Generic changes

  • Macro TrimmedClassName is available in code snippets. It contains the class name stripped from class prefix and generic parameters. For example, for TList<int>, TrimmedClassName contains "List"
  • Improved handling for abstract methods (similar for partial external methods): when making a method abstract, MM offers to clear any remaining code. The implementation view appears empty and disabled for empty abstract methods. If an abstract method contains code it will be displayed like before. This allows copying code out of abstract methods. Like previously, the code generator emits no code for an abstract method, even if its implementation is non-empty.
  • The Diagram Navigation Context Diagram can be printed - like other diagrams. It uses environment Printing Style to control black and white scheme, showing navigation icons etc.

Solved problems

  • The Name label in a class association would be prefixed with "class association" This bug was introduced in MM11. Solved.
  • Some operations (such as copying members to clipboard or using drag drop to rearrange classes in a module) would lock the Modules View until a next model change caused a rebuild of the modules tree. Solved.
  • Pascal: the parser would not recognize anonymous records in an "array of record end;" construct. Solved.
  • "Apply Class Template" and Members view "Paste" members from text would erroneously assign class template attributes to the model class - such as ancestor. Solved.
  • Modules view in order by namespace or folder structure would not always be updated after a modules was changed. Solved.

ModelMaker 11.03 Service update

Generic changes

  • Diagram elements like Actions, Use cases etc. allow hotlinking to other diagrams.

Solved problems

  • Syntax Editors could remain disabled in some cases - no workaround known. Solved.
  • Modules View could in some cases remain locked. Reactivating the modules view usually re-enabled it again. Solved.
  • Pascal: The Project Options | Coding Style | Property Access method Visibility would not be applied when creating new properties. Instead "private visibility" would be assigned. Solved.
  • Auto coloring based on stereotype would not work for Annotations. Solved.
  • Default Property "many" multiplicity was not assigned for indexer properties. Solved. Related: the "many" multiplicity would be applied to 1 to 1 properties. Solved.
  • Module documentation would not be emitted if default visibility was not included in documentation visibility filter. Solved.
  • Delphi IDE add-ins: to avoid conflicts with existing IDE shortcuts, the shortcut for "Refresh in model" now defaults to Ctrl+Shift+Alt+R and "Jump to ModelMaker" defaults to Ctrl+Shift+Alt+M.