I spent an afternoon going through the basics of working with packages with Morfik 2.1 and thought I’d share with you my first impressions. The first thing that came to mind when I first opened the sample packages available (as a separate download) from the Morfik website, was that the concept was really cool.
With that thought I proceeded to take on the task of creating a package of my own that would hold the bits and pieces necessary to do something useful. As always, when you set out to test some new technique or product version all ideas seemed to vanish so I just decided that I would do a package that allowed me to insert a blog-like list of articles into any application. That seemed simple enough and as it turns out it really is.
When you first decide to create a package you will need to get a package-ticket with Morfik. This ticket will reserve a three to six letter prefix for your use in creating your personal or business packages. This is handled directly in the New Package Wizard and the ticket is issued immediately. No bureaucracy, no wait.
When you complete the Wizard, while Morfik is “opening” the newly created package, an error is generated. You can safely press cancel and proceed to work in the package. This error is harmless and the result of a simple inversion in the order in which these items are opened after being created. As it turns out the IDE is trying to first open a test form containing a blank widget, before the widget’s creation has been completed. (Or something of the sort.:-) This issue should be corrected in a minor point release that Morfik will be making available soon.
Once you have created the package you will have a project which contains one form and one widget. The form is useful for you to test the objects you are creating within your package, without having to continuously add and remove it from other projects. The Package project can be run as it if it were a standard application. The actual redistributable file with the extention MFKPackage is actually quite small, if you haven’t added large resources to the project.
Adding resources to a package is an interesting area to consider as all packages you create will share a common resource root folder which has your package prefix, followed by an underscore as its name. In the case of MorfikWatch, for example, the folder is called mfw_. This means that you cannot have two packages that use the same name for two different images, as long as you plan on using them on the same project.
I’m not sure putting all the images for all packages I’ll ever create in the same folder is the best design decision, but I understand that it’s objective is to avoid having the same image added more than once to any single project. In that regard, this is probably a good decision.
It is obvious that Morfik considers Packages a natural environment for Widgets as any new Package comes with a pre-created Widget. The new features do really seem like an ideal match, as Widgets allow you to your own controls and packages provide a convenient mechanism for distributing them within your team or your customers.
Packages can, also, be great facilitators for larger developer groups. A project can be logically divided into packages so that it’s development can be easily handled by different developers.
What other uses can you think of for Morfik Packages?