Monday, February 28, 2011

How To Install eUML2 Free Edition

These are instructions for installing the free edition of the eUML2 Eclipse plugin.

From Eclipse:
  1. Help->Install New Software...
  2. Add/use software site http://www.soyatec.com/update/galileo
    • This works for Helios too.
  3. Check "eUML2 Free Edition for Galileo" and click Next.
  4. Keep following the wizard. If you encounter an error for a missing dependency (the GMF Runtime), you will need to install it manually before reattempting the eUML2 install.
  5. If you received the error, start over with Help->Install New Software...
  6. Use software site http://download.eclipse.org/releases/helios
    • This is for Helios, if you're using a different release, choose the right site for your release.
  7. Use filter text "gmf" and wait for it to load matches.
  8. Check "Graphical Modeling Framework (GMF) Runtime" and click Next.
  9. Keep following the wizard until it is installed. Use "Restart Now" or "Apply Changes Now" and return to step 1 to install eUML2.
  10. Enjoy working with UML (this is a required step).

Tuesday, February 22, 2011

eUML2 Class Diagram including Multiple Packages

It didn't seem straightforward to me how to do this so I'll explain the steps here. I wanted to generate a class diagram from my code using the reverse engineering capability of the plugin. This seems backward but I wanted to use it as a way to show my coworkers how the design of something already written looks visually. I have my code separated into different packages and wanted to make a diagram containing every package and show relations between most of the classes.

The overall concept of the class diagrams generated from the plugin is that each diagram represents one package. So first you must create a class diagram representing one of your packages. Once you have that, you can add your other packages to that diagram.
  1. Open the .ucd file for the existing diagram you have so far in Eclipse.
  2. Make sure you're in "Selection mode" in the toolbar.
  3. Make sure nothing is selected*. Then right-click on empty space in the diagram.
  4. Choose Insert->Package and pick the package you want to add to the diagram.
  5. A box will be added that represents that package. Select it by left-clicking on it.
  6. Then right-click and choose "Package Elements...".
  7. Check the boxes for the classes you want to show explicitly in the diagram.
  8. The classes should now be in the package box.
  9. Then you can select nothing* again, right-click and choose "Show All Associations" or "Show all Inheritances" if you want.
  10. When you have picked all the options you want, select nothing*, right-click and choose "Layout" to make it arrange things nicely. If you don't like the layout it comes up with, you can repeat the same action and it seems to cycle through a few layout options.
  11. You can save it as an image by selecting nothing*, right-clicking and choosing "Export as image" and following the wizard.
*Left-click on empty space in the diagram to "select nothing" i.e. make sure that no items are selected.

    Saturday, February 12, 2011

    Brominated Vegetable Oil (BVO) Soda List

    Brominated vegetable oil (BVO) is vegetable oil that has had atoms of the element bromine bonded to it: http://en.wikipedia.org/wiki/Brominated_vegetable_oil. It's used in many citrus flavored drinks that have a cloudy appearance. Clear lemon-lime sodas such as Sprite do not contain it.

    Its use as a food additive may have harmful effects on health. BVO has been banned for use in food in several places including Europe and Japan, but it's legal in the United States. This article from Scientific American explains the history of BVO and its potential dangers: http://www.scientificamerican.com/article.cfm?id=soda-chemical-cloudy-health-history.

    This is a list of brominated drinks that I have found so far. I will keep this list updated for your protection.
    • Squirt
    • Diet Squirt
    • Mountain Dew (all)
    • Orange Crush
    • Pineapple Crush
    • Peach Crush
    • Sun Drop (all)
    • Gatorade ("some")
    • Sunkist Fruit Punch
    • Sunkist Peach
    • Sunkist Pineapple
    • Fanta Orange
    • Fanta Orange Zero
    • Fresca (all)
    • Refreshe Diet Grapefruit
    (Edited 11/02/2011): A commenter today noticed that some flavors of drinks such as Sunkist do not contain BVO and instead have ester gum: http://en.wikipedia.org/wiki/Glycerol_ester_of_wood_rosin, which "...serves as a natural alternative to brominated vegetable oil, particularly in citrus-flavored soft drinks." Check the wiki for a list of drinks that contain ester gum.

    Monday, February 07, 2011

    Null Exception when Generating Classes using SpecificCompiler.compileSchema(File, File)

    I decided to try generating classes corresponding to an Avro schema I had created using SpecificCompiler.compileSchema(src, dest). It threw an exception "null" and I found that what it wants to do is create a File(parent, child) using the destination path as the parent and the namespace as the child. The problem was that my schema lacked a namespace and when child is null instantiating a File, it will throw a null exception.