Andy in the Cloud

From BBC Basic to and beyond…

Preview: Apex UML Canvas with Tooling API


Regular readers of my blog will recall my last post charting my exploits with the Salesforce Tooling API for a session I’m running at Dreamforce 2013…

Dreamforce 2013 Session: Apex Code Analysis using the Tooling API and Canvas

The Tooling API provides powerful new ways to manage your code and get further insight into how its structured. This session will teach you how to use the Tooling API and its Symbol Table to analyse your code using an application integrated via Canvas directly into your Salesforce org — no command line or desktop install required! Join us and take your knowledge of how your Apex code is really structured to the next level!

Screen Shot 2013-10-14 at 22.16.58As I hinted at in the last blog I was not 100% happy with the Mind Map visualisation I initially used. It was fun to play with, but I wanted to illustrate the use of the Tooling API with something more functional. So I went searching for a new library. I wanted something that was HML5 based, that would dynamically render as the user selected Apex classes.

Inspired by the ObjectAid tool, as well as some feedback comments describing a very cool PlantUML based Apex tool, impressively written currently without the Tooling API called PlantUML4Force. While PlantUML is a great library, it was not dynamic enough and ultimately I wanted to be able to better illustrate the separation of concerns in the diagrams by having more granular control over the final diagram. I eventually found a bit of hidden gem called UMLCanvas

I’ll eventually share this as a package once I’ve had a chance to work on it a bit more (it’s currently showing only UML Dependency relationships). In the meantime please take a look at the new video below and join me in my Dreamforce Session to hear about how I built it!

Technologies involved so far…

15 thoughts on “Preview: Apex UML Canvas with Tooling API

  1. Great work ( I hope you will share the code) and thanks for mentioning my Github repo.

    • Thanks Robert, i will indeed share the code in due course, and your most welcome for the mention, great work also!

  2. The reason why I choose to use PlantUML is the fact that its diagrams are nicely layouted by the powerfus GraphViz library.

    When you want to autogenerate UML diagrams from an org you will run into the same problem as own Schema Explorer – unreadable diagram 😉

    Relying on Graphviz means you rely on an non-native server component. That indeed is a problem. But I planned to solve this by hosting a PlantUML instance on a own Heroku instance.

    • Yes I actually spent about half a day going over and over the decision to use or not use PlantUML, the reason being it is very pretty and has an nice auto layout engine!

      Ultimately aside from wanting something more drag and drop dynamic within the page. I also found that Graphviz is a native compiled executable, so was not sure if Heroku would tolerate that (as i also would prefer to host the library separately). I found some postings that suggested it would not, but did not dig deeper. It’s a shame there is not a Java version of it?

      Also to keep in mind, is the maximum URL length, I’ve read reports on the internet this is 2000 characters, though can be considered to be more. Watch out for this if the UML information your passing to the hosted PlantUML end point via HTTP GET grows large.

      BTW, one other thought I had, was to one day create an Apex Wrapper around the Tooling API, much as I have done with the Metadata API. This would allow you to keep your solution native. Though i cannot say if the Tooling API callouts and/or request size limits in Apex might yet present a problem in such an architecture.

      Great as always to chat with you, are you making it to Dreamforce btw?

  3. Nice stuff, we can seriously visualize design patterns! And, object inheritances.

    • Thanks and yes indeed, I’ll be using it in my design patterns session as well i think! You’ll notice the demo uses the patterns sample app code already… 😉

  4. Pingback: Apex UML Canvas Tool : Dreamforce Release! | Andy in the Cloud

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s