Archive for March, 2010
Generating a Graphical User Interface
Remember my factory method design pattern example to compute the first name and last name from a full name?
![]()
No? It’s really easy. You only have to provide a full name, like “John Doe” or “Doe, John” and the business logic computes the correct first name and last name.
This time we are not interested in the business logic and data binding, but we are going to generate the graphical user interface!
First, we have to model the form.
We can do that with UML. Use your favorite UML tool (StarUML), export to XMI. Finally, feed the XMI to a code generator (MyGeneration) using the right templates.
That’s all there is!
Extracting Business Knowledge From Data Models
Recently, I was following a discussion on extracting business knowledge from UML models. UML models, UML models, and more UML models.
Slowly a thought was emerging from my soaky brain:
hey dude, data models are models too.
In fact, a data model doesn’t always have to be represented by an ERD diagram.
It is also very feasible to diagram a data model using UML class diagrams. It even gets better when you stereotype your classes <<table>>. This enables code generation software to automagically recognize the stereotypes and – for example – generate SQL script for you.
Why on earth that could be remotely interesting?
Because your model is independent from its physical representation.
This way, you can “extract” a model from the physical database, introduce some enhancements, and re-apply the enhancements to the original physical database.
It enables you to enforce an uniform use of naming conventions.















