The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Creating symbols

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Steven Kelly

Posts: 294
Nickname: stevek
Registered: Jul, 2005

Steven Kelly is CTO at MetaCase and lead developer of the MetaEdit+ Domain-Specific Modeling tool
Creating symbols Posted: Feb 7, 2007 11:17 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Steven Kelly.
Original Post: Creating symbols
Feed Title: Steven Kelly on DSM
Feed URL: http://www.metacase.com/blogs/stevek/stevek-rss.xml
Feed Description: Domain-Specific Modeling: A Toolmaker Perspective
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Steven Kelly
Latest Posts From Steven Kelly on DSM

Advertisement

Microsoft's Mike Hatch is trying to use DSL Tools to build a simple architecture modeling language, ArchiMate . To get an idea how simple the graphics are, look at the notation . Even so, he hit problems right at the very start: DSL Tools only supports some predefined arrowheads for roles -- the ends of the lines that attach to objects -- but he wanted a circle. With some help from the forum, he got things working by hand coding 50 lines of C# . The result includes such pearls as:

protected override System.Drawing.Drawing2D.GraphicsPath
GetPath(Microsoft.VisualStudio.Modeling.Diagrams.RectangleD bounds)

Since I wanted an excuse to play around with screencasts again, I made a quick one of how to do the same thing in MetaEdit+: draw a circle. Yup, that's it: took less than 10 seconds to open the Symbol Editor from the model, draw the circle, and save the change so the model updated on the fly. Just to prove that there's no "customization cliff" waiting right after a plain back circle, I went on to make the circle orange, with a radial fill to make the circle look like a sphere with light shining on it, and moved the center point of the fill to make it more 3D. Total lines of code: 0. Total time: 35 seconds (the movie carries on for another 10 because the otherwise impressive BB Flashback Express won't let me crop it).

If you're lucky, the screencast is below (339KB Flash). If it doesn't appear inline, you can go here. There's no sound, but you can scroll back and forth and refer to the previous paragraph if you feel lost.

Some things to spot:

  • The model updates instantly as soon as the changes to the symbol are saved. This makes it rather easier to get the right size than if you have to type "((float)(bounds.X + .01), (float)(bounds.Y + .01), (float)(bounds.Width * .8), (float)(bounds.Height * .8));", close the entire VisualStudio with the model, regenerate the XML files, recompile and link, and restart the entire VisualStudio with the model.
  • The green "Actor" symbol in the model takes about 30 seconds to draw. Fountain fills are just eye candy, but kind of tasty.
  • If you build a symbol in MetaEdit+ today, it will work in all future versions. If you build a symbol by writing 50 lines of code in DSL Tools today, I wouldn't place any bets that it will work in even the next minor release.
  • You caught me using a UML model! I promise it won't happen again...

Read: Creating symbols

Topic: Anti-mac fanboys Previous Topic   Next Topic Topic: Finally, TP 2.0 Released!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use