- Magento Front Controller
- Reinstalling Magento Modules
- Clearing the Magento Cache
- Magento’s Class Instantiation Abstraction and Autoload
- Magento Development Environment
- Logging Magento’s Controller Dispatch
- Magento Configuration Lint
- Slides from Magento Developer’s Paradise
- Generated Magento Model Code
- Magento Knowledge Base
- Magento Connect Role Directories
- Magento Base Directories
- PHP Error Handling and Magento Developer Mode
- Magento Compiler Mode
- Magento: Standard OOP Still Applies
- Magento: Debugging with Varien Object
- Generating Google Sitemaps in Magento
- IE9 fix for Magento
- Magento’s Many 404 Pages
- Magento Quickies
- Commerce Bug in Magento CE 1.6
- Welcome to Magento: Pre-Innovate
- Magento’s Global Variable Design Patterns
- Magento 2: Factory Pattern and Class Rewrites
- Magento Block Lifecycle Methods
- Goodnight and Goodluck
- Magento Attribute Migration Generator
- Fixing Magento Flat Collections with Chaos
- Pulse Storm Launcher in Magento Connect
- StackExchange and the Year of the Site Builder
- Scaling Magento at Copious
- Incremental Migration Scripts in Magento
- A Better Magento 404 Page
- Anatomy of the Magento PHP 5.4 Patch
- Validating a Magento Connect Extension
- Magento Cross Area Sessions
- Review of Grokking Magento
- Imagine 2014: Magento 1.9 Infinite Theme Fallback
- Magento Ultimate Module Creator Review
- Magento Imagine 2014: Parent/Child Themes
- Early Magento Session Instantiation is Harmful
- Using Squid for Local Hostnames on iPads
- Magento, Varnish, and Turpentine
The PHP community draws developers from all sorts of different backgrounds — there’s the technical and academic on one end of the spectrum, and the bang on the keyboard until it works on the other. Because PHP is such an accessible language, all these people are writing code that solves their problems. In some cases “writing code” may be an overstatement — editing files that contain code would be more accurate.
This presents a dilemma for people on the technical/academic side. Namely — what sort libraries and tools should we be building? Make something too abstract and the folks on one end of spectrum lose out. Make something too simple and we curse ourselves to banging out repetitive error prone code.
Time and time again, the comprise PHP projects come up with is code generation. That is — we accept that some systems will be too abstract for non programers to understand, so we develop systems that automatically generate the boring, repetitive code we don’t want to be stuck writing.
Magento Code Generation
Magento’s no different — although I’ve always been surprised how stunted the evolution of the Magento code generation tools are. The structure is there for something like the Rails command line, but our code generation tools never reached that level of sophistication. The original Netz98 module creator (also on GitHub) took a bold step in that direction, but never went much beyond the generation of a single CRUD model in a Magento module.
Despite this, up until a few days ago I still recommend The Netz98 Module Creator as a way for newbie Magento developers to get a feel for the structure of a Magento admin module. I was Googling for it the other day, and was surprised when a different project popped up higher in the listings.
I’d heard of Silk Software’s creator before — but since it’s not open source I wasn’t interested. However, I’d somehow missed the Ultimate Module Creator. When I clicked through to the Magento Connect page (also on GitHub), I was surprised to see The Magento Stack Exchange champion, Marius. How had I missed this?
After reviewing the features, the Ultimate Module Creator is a big step forward from the venerable Netz98 project. If you’re doing custom Magento development with many entities, you owe it to yourself to take a look.
Ultimate Module Creator Features
The first step forward for the Ultimate Module Creator is — it’s distributed as a proper Magento module. Files are installed in the following locations
app/code/community/Ultimate/ModuleCreator/
app/design/adminhtml/default/default/template/ultimate_modulecreator
After installing the module (manually, or via Magento Connect), you’ll have a new Magento admin menu item: System -> Module Creator
Clicking on this link brings up a grid of all your saved modules. This is the next way the Ultimate Module Creator is superior to projects that have come before — you can save your module’s configuration, come back, make adjustments, and re-save the module. Most other module creators I’ve seen are stateless — once you generate a module, that’s it.
Clicking on the Create New Module button, or editing an existing module, will bring up the Magento standard multi-tab Ultimate Module Creator user interface.
Here the Ultimate Module Creator suffers from its environment. The creation of a Magento module has a lot of different options. Magento default UI widgets are optimized for a simple “this field correspond to this value” user experience. The first time you look at the module creator UI you may feel al little overwhelmed.
The key to these sorts of user-interface patterns is they require the user to invest a bit of time learning about the problem domain the application is solving. This requires more investment that the typical “intuitive on the first run” patterns that are popular in mobile development today — but once you learn the interface, you’ll have a much more powerful feature set on your hands.
Marius seems to understand this trade-off, and accommodate for it. Each field in the UI has an additional help icon
Clicking on this icon will bring up a small help dialog explaining what the field is for.
This allows expert users to quickly center themselves in the application, and gives novice users the nudge in the right direction they need. All of these help fields are also repeated in the Help
tab
Clicking on the Entities tab brings up the other major innovation in the Ultimate Module Creator
Namely, you can setup multiple entities in one module. For reasons that are a little opaque to me, the idea that a single Magento module can contain multiple CRUD models was met with resistance in certain development communities. Ultimate Module Creator embraces the natural design of Magento, and lets you create an unlimited number of models entities for your module.
In fact, not only does the Ultimate Module Creator embrace the design of Magento, it brings missing features to the ORM. Once you’ve setup multiple entities, you’ll have access to an Entity Relations tab. Here you can create parent/child or many-to-many relationships between your entity models.
Similarly, there’s also options that will allow you to setup relationships with products.
This feature will also give your entity UI forms an AJAX product picker.
There’s tons of other features as well, including
- Creation of front-end files, and a front-end view controller for your module
- Widget creation
- API Module Creation
- RSS Feed Creation
All in all the Ultimate Module Creator lives up to its name and is a worthy successor to the pioneering Netz98’s venerable Module Creator project. I’ll be using it on my future Magento projects, and I’m looking forward to the new version Marius is working on. We all owe an open source debt to Marius for creating such a valuable and feature rich tool.