the world of model driven development

Posts tagged ‘mendix’

The refactoring factor

The world we live in is fascinating and its easy to take amazing things for granted that make our lives easier.

If you have some coding experience and had to refactor some piece of working software you will probably appreciate the tools that allow you to do refactoring.

I became a Python developer after some years’ experience in Java because of its “hassle-free” dynamism that liberated me from primitive text-based IDEs and static compilers. This was until I revisited all the cool IDEs, like Eclipse, that made Java an attractive development technology again, not because something fundamentally changed in the language, but because the tools made coding much more enjoyable, like refactoring your code without breaking it.

If you are a Mendix Business Engineer you are not excluded from the fold of the fantastic refactoring forte. You probably just haven’t been made aware that you are.

Loosely stated

“Code refactoring is a disciplined technique for restructuring or altering existing code and internal structure without changing its external behaviour, undertaken in order to improve some of the nonfunctional attributes of the software.”

The ability to change chunks of  what goes on “behind the scenes”, like data models and flow logic where the end-user is unaware of these changes, is an almost everyday occurrence. Ever noticed the errors in your Error viewlet in the modeler when you’ve made structural changes, like deleting an association or adding an enumeration though not changing any interfaces? Well, this is the modeler implicitly guiding you in some cases to apply refactoring.

Refactoring in action

This past week we delivered a project for a sprint review where we had to implement a new complex widget 30 minutes before the actual review as our definition of done was in a liberal phase. The implementation wasn’t a straight forward one as the data model required to operate the new widget was fundamentally incompatible with the existing model.

Needless to say, the business modeler allowed me to make huge changes and commit it back to the cloud in 29 minutes. That was quick refactoring for that load of work. I was thoroughly impressed with this gamble and needless to say the review was positive. Now, the obvious way to solve these kind of “cutting the red wire a second before the bomb goes off” situations is to avoid them entirely, but the rule however does not cover the exceptions and exceptions occur and you have to be flexible when it happens.

One feature worth mentioning is the Extract Microflow that allows you to take a selection of actions in your microflow and promote it to a separate microflow. Its clever enough to infer what parameters are needed and pre-populates the new microflow with them, returning a value if needed. Having this kind of refactoring capability inside a modeling tool is very cool indeed:To wrap things up, here is a little video demonstrating some refactoring in action. Its a simple app that starts up with a search screen that allows you to find existing customers. If they are not found, the app creates them using the “Get-Create” design pattern discussed in an earlier post.

Note that the app should work as it did after the changes, only improving the inside guts of our system. In essence the change allows us to make a sub section of our microflow re-usable by future improvements and cleans up an existing microflow.

Epic Mendix 4 Release

May the 4th be with you came and went, and though it seemed to be a fitting date for the announcement of the next version of the Mendix modeler, it came today none the sooner and promises to be yet another smashing release.

We were provisioned with a courtesy copy of the beta, and it is absolutely packed with features. It hallmarks an array of productivity enhancements and new technology, including the ability to develop mobile-based web forms. Its one of the major highlights of the new release but in no way overshadows the countless other tweaks, enhancements and new features included with the new modeler. We find the new additions very welcome and timely, since we’re already benefitting by it in a big way.

It’s epic feature discovery and has the same kind of excitement that accompanies a new release of a Star Wars episode; for those who are fans. We won’t be covering everything in a single post, its too much to cover, so we will attempt to uncover some, if not all of the new features, in the weeks to come.

Grab some popcorn and enjoy our little fan “film introduction” we made for the Beta and go grab the Modeler and see what you can find out!

Mendix Spring 2012 Release

Today was a lot like when the Apple Online Store is down and the famous yellow “We’ll be Back Soon” sticky gets some web-time. It was a morning of click refresh until at last the site was back up.

After snapping out of the hypnotic effect that the new Mendix website had on us, we managed to log in and notice a huge overhaul of pretty much everything. The Public Facing website’s change is welcome. It looks inspiring and takes the game up a notch. Its not just a pretty face though; there are a lot of substantial changes inside too.

It boasts a unified platform, integrating Sprintr™ and the cloud portal into 1 unified experience. The forum still seems to be a separate entity though, but all the other portal bits and pieces are being fused together. The first thing that caught my eye after I logged in was an IM chat widget in the right bottom corner of the portal and an improvement to the layout. It feels more like an app now and looking for “the old stuff” is feels a bit like finding easter eggs.

Most importantly is the new platform. Mendix 4 has a lot of new offerings which we’ll introduce a bit later today.

Here are some of the highlights in the new release:

  • Mobile for the Enterprise
  • One Platform for All
  • Social Productivity
  • Enterprise Integration
  • App Mash-up
  • Improved Performance
  • Non-persisting entities
  • Overall enhancements, tweaks and improvements

Click here to view the official release notes.

Spring is in the air (if you live in the northern hemisphere anyway)

This morning I tried to acquire a Mendix license for a project we are working on, when curiously enough the website had this message displayed. I wonder whats in store?

I know I’ll be refreshing my page the whole day, or I’ll just use that monitoring tool I wrote in Mendix to email me when they go live, or see if Mendix emails an announcement before that.

7 Hotkeys of Highly Effective People

Clicking is sometimes a drag, especially when you are on fire. You don’t want to break your momentum by taking your hands off of the keyboard to invoke some action on the screen. You need hotkeys.

I’ve watched releases of the modeler carefully, and now and then a new hotkey sneaks in without huge fanfare. Here are some that my fingers find most handy.

F5, Run Baby Run

I develop on a Mac, and leverage many of its tools, and the command-line is one of them. Sure not all Business Engineers will be power users, but sometimes you’ll find some Business Engineers need a little more umf now and then. For instance, when designing themes for Mendix, I need to make minor adjustments to my theme and apply it real quick back into the zipfile. After making these changes I cmd-tab to my terminal, hit the “up” key to get my last zip bash command, then cmd-tab back to my Mendix modeler, and hit F5. This gets repeated frequently if my design changes with many little iterations. Better yet, let me just show you 1 iteration. Notice the mouse cursor stays in one place.

Shift-F5, Stop

What goes up, must come down. Use Shift-F5 if you need to stop your server. You’ll probably use this infrequently.

F2, Garden-Variety Rename for Windows

This is a bit redundant, since you can start typing away at captions in your microflows or widgets on your forms. The only time this will be useful, is if your properties pallet has focus on another field than the Caption field.

Ctrl-Left & Ctrl-Right, Moving stuff

This one I absolutely love. Entities with lots of attributes generate grids on forms that contain a horde of columns and search fields. If only there was a way to sort them quickly. Talk is cheap. Lets see it in action.

F11, Maximize and Restore

And as you’ve seen in the previous video, F11 is a must if you work on a screen with little real estate. Use this key to maximize your workspace.

Ctrl-G, Goto Artifact

This one is handy if you know what artifact you want to navigate to within your model, without hunting for it in the Project Explorer.

Another handy trick, is using the Mouse’s middle button on the microflow canvas. Its helps you pan your view, and using the mouse wheel, helps you zoom in and out if you don’t use a Magic Trackpad™.

Productivity is like Formula1 racing. Every little improvement helps, even if it contributes a 1 or 2%. Once you try hotkeys, you will find your ergonomics improve, your fingers do the work and helps you move with incredible ease through your modeling routine letting you focus even more.

I’m burning to see more hotkeys in future versions of Mendix.

What if you are too fast?

Picture this. You are in a 120 km/h zone, you’re driving a car more capable than the speed limit and you need to be somewhere, but you are stuck in a traffic jam. This is familiar to most people: A traffic jam. What should be a speedy highway, is now the world’s largest parking-lot. The same thing happens when one has a more capable tool that demands a faster development pace for efficiency, but the current environment is in a dead-lock of inefficiencies and status quo’s.

Mendix Business Engineers have the opportunity of churning out functionality really fast. So fast, some regard it as disruptively fast. The environment cannot adapt quickly enough to change, especially if the organisation has processes built for traditional development teams. People with job-insecurity might perceive this as invasive, they typically do not like change and might even consider the current state of affairs as optimal

The cause of some dead-locks in IT, is dead culture. Tradition determines culture; it is distilled from experience and gathered over time and determines the way we work and the way we predict outcomes.

Here are some telltale symptoms of a bad cultural legacy:

  • slowness to react or adapt
  • taking little ownership over the domain
  • lacking creativity and craftsmanship
  • failure to understand business and a dependency on spoon feeding
  • too many impediments caused by technological constraints
  • an incompatible vocabulary with business
  • a “not-invented-here” syndrome
  • leaders threatened by new technology not their flavour and that use straw man arguments to keep the status quo
  • an attitude that limits Business and often dictates what can and can not be done
  • an environment where failure is punished and innovation can not happen.
  • an environment with a gang culture where the choice morsels of knowledge of systems are only shared freely with those that comply with the gang’s culture and is liked by the alpha members of the pack

If these indicators match we can expect an environment where we need safety checks and processes that protects team members and dictates to the development team and business, in short and environment with lots of red-tape and ego’s. Processes and formalizations are always necessary, but the tail should not wag the dog. These should be support processes, not impediments. And often we find that in such environments the current “best practices” are not even blogged, documented or publicised and provides and insecure environment for any innovation to happen safely.

Most entrenched coders want job security, and want to be spoon-fed what business requires. They are low-risk – but not in a progressive way. Completer-finishers are crucial to teams but often fall into the low risk, pro status quo group that like security, getting things done – but generally happy to introduce technical debt at business level just to “get the job done”.

Everywhere we go, we see a general pattern emerging: Business is not happy with the pace of development that current IT shops can deliver. We see a similarity emerging with the construction industry where roles are clearly segmented in verticals and specialisation forces people to silo and only look down at their part. For instance, a brick layer only lays bricks and does not have the ability to read and interpret the architect’s plans. They rely on supervisors to take ownership and just do their thing. Plans can never detail everything and clients often feel cheated at the results they get. They feel they pay too much, get too little and that it it delivered late. The answer is typically to get new builders, new plans and better plumbers. And better processes. What we need is more than that. But a better process is a start.

Like Scrum. Implementing a better process is an excellent start. However, few seem to understand that it is a framework that requires customization to fit and optimally serve the environment. It can change the environment as its provides a division of roles with the minimum one should have to be successful in systems development. But we see environments where “the way we do things” are branded Scrum and is not allowed to change when required. The Scrum term gets branded against any disruptive force and Scrum’s rhythm and velocity arguments are used to structure teams in ways that do not make sense – when the goal is to develop great systems that satisfy the business requirements and where rhythm, velocity, measurability etc. should be supportive of this rather than the goal! The tail wags the dog. IT is there to write great systems that allow business to double their business.

Mendix engineering is fundamentally not traditional development. Mendix teams will find that they will have to challenge these processes to gain maximum efficiency and freedom to create business value. One needs to reform what IT means in the eyes of everyone else. This is a gigantic task and may take some time to break the deadlock depending on how agile your company is. It will be a change that will require time and effort and will probably upset people who are comfortable and in cozy jobs. An Oil Tanker takes a long time to change direction, and it is to be expected from other large organizations. Hang in there and work with lots of compassion, openness and communication, however do not comply with bad/non-optimal practices just to keep the peace. We have to put business first.

Mendix, as quick as it is, is not a silver bullet. The processes and approach around Model and Domain driven development needs reformation. Pick your engineers carefully, since they will be your first line of change agents and culture trend-setters, the ones who will share the vision of your business. If you want a comfort delivery zone and do not like change – look somewhere else for a solution as this is not a get-popular-quick scheme but a new and fresh business driven approach to churn out value with lots of changes to support that. It offers a new set of experts and building techniques that allows us to focus on what our clients wants and works best in an environment where ownership and initiative is encouraged rather than playing the blame game that results in dead culture and causes people to hide behind red-tape.

Format String – Widget spotlight

There are a lot of widgets available in the Mendix Apps- & Add-on Store. Basic display widgets are sufficient for building forms, but sometimes you need a little more kick than what you get from the out-of-the-box widgets. For instance dynamic labels. Creating your own widget is an option, but don’t reinvent the wheel when someone already has, which you’ll find out when you visit the store.

I found Format string and it has some nifty applications. Think of it as an “über-label”, giving your Crud applications a little bit more character in terms of dynamic display. Its handy for dynamic label messages or basic reporting, by allowing you to format a string; very much in the same way we do logging-style messages in Mendix apps. You do this by setting a format string and replacement parameters.

Here is an example. I have a customer as an entity on my form. Instead of displaying a read-only Name and Surname Text box, you simply add the label and use the token place-holders:

Under Data source in the property panel, you select your attributes:

You could also have the ability to format dates and the option of rendering this as a div or an input. With a style formatting you’ll have a perfect header for your report or section in your form.

The result:

I’ve look for something like this for a while now, and this is perfect. It does exactly what I want when displaying dynamic labels.

My favorite Mendix 3 Feature – Version Control

Without a doubt, one of the coolest features of Mendix 3 is Version Control. Previously, Mendix development was a bit like living in the wild west. If you messed up a microflow or data model, you would just delete it and remodel it in a few minutes, because its that agile. After all, you just need to understand the business to model at fast draw speed, but still you had to ask yourself one question: ‘Do you feel lucky?’ Well, do ya punk? Cause there is no turning back without source control Harry.

Its the topic that is bound to pop up when talking with techies. “What version control do you use?” Admittedly, the answer starts with a slight “uhm well” and ends up in a justification that “in Mendix you model so fast, the model is self-explanatory and that source control is obsolete and only sissies use it“. Thats all true in a gunslinger-way, but the reality is that in distributed development teams and complex systems, visibility of changes and traceability of contribution is key in making collaboration a smooth process. Rolling back to some old code is inevitable, so fine historical granularity is key.

That being said, Mendix 3 has it now, but what’s under the hood? The guys up in Rotterdam chose subversion for its version control because of its maturity and particular feature-set. It leverages diffs to control changes made on the model on a finely grained level, which is the coolest thing since Clint Eastwood.

But thats not all. It also integrates into Sprintr™ (aka Team Server), and deprecates the traditional multi-developer projects that is dependent on connectivity to a centralized database repository, either by local connection or you had to have a good internet connection — where here in South Africa its still pretty much the wild west today. With SVN you can work on a local copy and merge your model at a later stage, not to mention all the other benefits you get from a VCS, like commit messages and conflict resolution. Using Sprintr™ in a scrum environment, its a handy way to relate changes to user stories. There is a lot of good stuff in there.

Now you can enter that next technical discussion with confidence, not having to dodge the bullets around the lack of source control. “Go ahead, make my day.”

Model Driven Development and Beyond!

Model driven development and beyond! See what I discover what works and what doesn’t.

I will be blogging on my Mendix development experiences and Modeling in general. The challenges that await the world of interdependence between business and IT. So, here we go.

Adventures await!

Design a site like this with WordPress.com
Get started