Thursday, February 25, 2010

To reuse or to redo.. that’s the question…

Redoing recreation….
When we were children we used to watch repeatedly that movie we enjoyed so much, we used to read over and over again that book that was so fun for us before sleeping. We loved to play once and then again the games… and we still do that. We still enjoy going to eat at the same restaurant, visiting the same friends, playing the same sport, listening to the same music etc.
It is very enjoyable for us to “redo” some aspects of our lives, we like it, we do it and redo it, and we feel happy about that, don’t we?

Redoing work…

Didn’t we listen or say something similar to this before? “Oh no! There is no milk in the refrigerator, I have to go again to the supermarket!” – or – “I wish I had a robot to prepare my coffee, to bake a cake every morning, to dress my children and take them to school, laundry”…

We “redo” everyday a lot of tasks that we do NOT enjoy and we would prefer them to be already done, wouldn’t we?

A solution not to redo what we don’t like to: REUSING
When developing and analyzing web applications we realized there are certain common problems for all web applications, even if the ways of solving them are different.
As a result of that, when we start to develop a new web application, we need to develop the same components we have done repeatedly before, in order to assure that the “common problems” will be solved for this new web application too. So we need to REDO; we don’t like that, and maybe we can’t do that because time is precious and it is not possible for us to spend so much time doing something we have already done so many times in the past.
So, we ask ourselves what would happen if we had “that robot” to “redo” all this solution for us? Maybe, to prepare coffee or to fry an egg it’s not affordable to have or maintain a robot; maybe we cannot buy a machine to redo for us a complex task. But, what about redoing something that can be saved and reused without effort?

The GeneXus USA CORE

GeneXus USA has developed a GeneXus core module which is used at the beginning of every web application project. It is a set of Transactions, Tables, WebPanels, Procedures, Structured Data Types; a set of basic developed functionalities very useful for all applications. It is “table driven.”
The driving forces for creating Core were SECURITY, Menus, and to save time. Core still lets developers customize their application for their particular application by simply implementing some GeneXus objects that will be explained.

A very simple example
Starting a new KB with a very important base: the Core, I have created three very simple transactions and applied to them the Work With Pattern. Now that I have my web application, I would like to make it a secure web application; so I will reuse the core security module and by implementing a very simple set of procedures my web application will be ready to be used by different users, with different roles and permissions!

What did I have to do?

1. Initialize/Create all the pages
2. Initialize/Create the application Roles
3. Add pages to Roles
4. Create Users
5. Add Users to Roles
6. Add menu/submenu
7. Set the application parms
8. Prepare and run the RoRunOnce routines

1. Initialize/Create all the pages

We call initialize a page to add a reference to the page into the system database. A page can be either a Transaction, Webpanel, Report or a WebComponent.

The core provides a “Pages” table where the system checks the security for each page. In other words, security is defined by page. In order to do this all the pages must be defined in the system using a procedure. By default the core will load its own pages in the page-table but each application will need to create their own pages in this table.

If we have a lot of different “pages” that conceptually are different modules, we should create a special procedure for each module that inserts into the Pages table (CePages) the reference for the transactions I have created. It also adds the reference for all the pages that were automatically generated for the Client, Invoice and Product by applying to them the WorkWith Pattern.

2. Initialize/Create the application Roles

Core comes with two preset roles: ADMIN and Root.
In the majority of the cases, these 2 roles are not enough for our application purposes; that’s why we could need to have a bigger set of roles. In order to easily achieve that, the core has a “Roles” table which saves for the system the different accessible roles (by default it comes with ADMIN and Root).

I have created a procedure that inserts into the Roles table (CeRoles) the reference for two new different roles.

3. Add pages to Roles
Once we have defined the pages and the roles our application will have, we need to tell the system what their relationships will be. In other words, which roles will be able to access which pages.

4. Create Users
The core already comes with pre-defined ADMIN and SYSTEM users, which are allowed to use all the pages of the system. Both are saved into the Users table (CeUsers) from where the system takes the information for the login.

If we want to add more users to the system, we can do it either at the beginning of the project, by adding the information from a procedure (like in the previous examples), or by inserting them manually with the WorkWithUsers webpage on the web application.

We recommend inserting them by a procedure in order to be able to reproduce it in a specific case.
I have created for this kb two users in order to make the first one have the first role I had added, and the same for the second user with the second role.

5. Add Users to Roles
Once users and roles are ready, it is time to tell the system which users will be configured for which roles.

6. Add menu/submenu
The core implements a User control (JSCookMenu) and it comes with a predefined menu.
The “predefined” menu is a dynamic menu that loads it titles and links from a “Menu” table (CeMenu).
If we want to add menu tittles with their submenus and links, we have to create a set of procedures that initialize that information into the CeMenu table, in order to load that information at the beginning.

7. Set the application parms
The core uses a “Parameters” table (a very often-used and known concept for applications) that already comes pre-loaded with some useful parameters.
If needed, we can add more parameters to that table and simply access them from anywhere by calling the related procedures (already developed into the core) to access, delete or update any parameter.

8. Prepare and run the RoRunOnce routines
Once we have defined all the settings that we need in order to customize the security of our web application, we need to call all the procedures that initialize the information, from a unique webpanel that will be called just once, before starting to use the system.
Therefore the name of the webpanel: RORunOnce.

The RORunOnce webpanel is the one in charge of loading all the preset information into the system. Once it has been run, the system is ready to be used with security and menus!

Sunday, February 7, 2010

My top 3 User Controls

The User Controls start with GeneXus X. Basically a user control is a control that encapsulates the presentation layer of a given functionality.

User controls are extremely easy to use and any person with a very few knowledge in JavaScript or HTML can build there own user control.

With the release of GeneXus Evolution 1, there was an explosion of user controls in the GX Community. The Community started developing not only user controls, but also developed libraries of User Controls. The user controls are not only just a simply menu or chart, they become controls with very complex functionality.

Nowadays there are around a hundred of user controls, and I want to share my 3 preferred ones.

Query Viewer

The query viewer is used to display, in a web form, the result of a Query Object or a Data Provider. It has several visualization options, such as pivot table, table or chart and this property can be changed on run-time. With the QueryViewer User Control and the Query Object we can achieve very complex queries in a very simple way. We just need to define a query objectand we use the query viewer to show the result of the query.

Here is an example of how easy is to use it.

First define the query on a Query Object:

After we have the query defined we need to drag and drop the query viewer user control from the user control section on the toolbox to a web form and set the Object we want to use for the query, for this example, we choose the Query Object KPI_Cost.

That is all we need to do to display something like this:

With the query viewer and the query object we can create and display very complex queries like the following in a few steps.

As a reference here is the link to the query viewer control in the wiki. There you will find a full explanation on how to use it and several examples.,


The GXScheduler user control allows managing a schedule of chronological events. As most calendars, there are three different views; by day, by week or by month.

Apart from showing the calendar events in a very nice and modern way, it is also extremely user friendly as it allows to add, edit and delete the calendar events directly from there. As an example, the user in order to create a new event, just needs to click over the date on where he/she wants to put the event. This is a clear example of how the user controls are not just anymore a simple chart or image gallery.

This UC provides a very complex functionality and is also extremely easy to use.

In order to use it, we just need to create a data provider from the data that we are loading into the calendar. After that we need to drag and drop the UC to a web form and we set the Data Provider, then we need to set the property LoadEventObject of the user control.

As a reference here is the link to the GXScheduler control in the wiki. There you will find a full explanation on how to use it and several examples.,

gxui Library

The gxui Library has 11 user controls, most of them are used to create cool and user friendly user interfaces.
Which are: gxui.EventObject, gxui.Grid, gxui.Layout, gxui.Menu, gxui.Message, gxui.Panel, gxui.Settings, gxui.TabPanel, gxui.Toolbar, gxui.Treeview and gxui.Viewport.

The gxui.Grid is a very powerful grid in which you can sort for each column, hide and show the columns at run-time, interchange the columns, or (display in this example) swap the Price column with the Change column. It also allows multiple row selection. It has a search criteria section and automatic paging. This UC is not very simple to use but in GeneXus Evolution 1 we can give the appearance and functionality of the gxui.Grid just setting a property on a common grid.

Another user control from the gxui Library that I really like and use is the gxui Layout.

This UC divides the screen in 5 sections, north, south, east, center and west and the user can expand or collapse each section. Another functionality that it provides is to drag and drop a panel of each section to another section so the user has the ability to customize their own screen. In this picture there are almost all the user controls from the gxui Library.

As a reference here is the link to the gxui Library in the wiki. There you will find a full explanation on how to use it and several examples.,

You can find a lot of documentation for user controls. Here are some useful pages on where you will find all the information you need to start using them or discover new user controls.

Each time you are going to start a new development or feature, take your time to see if there is a user control that already solves what you need to do, you will save a lot of time!

Wiki user control page:,


User Control samples:,

Monday, February 1, 2010

In reply to Harry's XPM questions...

This post started as an answer to one comment posted by Harry, but then I thought it was better to publish this in the main-stream, so it does not get lost in the comments section that currently is not being used that much.

XPM & qControl

Harry: How does XPM relate with qControl

[Note: qControl is the tool that we currently use for issue-tracking]

XPM supersedes qControl. In truth XPM was developed from qControl but we changed the name and not just the version because in many ways it is a different product. It has a more flexible/open design, a complete redesign of the UI, etc -. We will stop using qControl soon.


Harry: How can we merge this technology (XPM) with agile methodlogies (ie SCRUM)?

XPM is not tied to a specific methodology though it is influenced by the methodology that we follow in-house to track our projects, so it does support an agile-development process. The issue-tracking module in XPM really allows you to use the methodology that you want (though you will not see labels that are related to that methodology, i.e. in XPM we have a "work-item list" insted of SCRUM'S "backlog").

Our idea was to create something that is open enough that it supports different scenarios/methodologies. If your team follows SCRUM you would need to do some mappings between SCRUM concepts and XPM's - for example in SCRUM you might define that a task in the backlog has a low fidelity (i.e. it is a 'vague wish') that would prevent this task to be part of the 'sprint-backlog', until it is properly defined etc. In XPM you would handle this with different statuses of the work-item (i.e. if it needs to be specified it will be in status 'To-Specify', if the functionality is not really clear and cannot be specified yet because it is a vague wish it would be in status 'To-Review' etc.. The list of possible statuses in XPM can be defined so the descriptions and the steps are up to you)-.

Similar to SCRUM, each item in our work-list is really anything that needs to be done (i.e. software functionality, marketing, non-functional requirements, etc). You can define work-item types and categories to classify them in case you want to assign the work-items based on that. We do have the idea of priorities that can be used to define what's in the sprint or what's in the product backlog.

XPM allows all the team members to participate and gives different rights to different roles - so for example you could have the Product Owner and Business Owner or the Scrum Master (those would be your roles) with the ability to update priority but do not give that ability to Scrum-Team-Members.

We also have the idea of releases that include all the Work-Items that are ready to be deployed depending on the environment (i.e. release for testing, release for QA, release for Prod). We do not associate the work-items with a specific sprint but we could do so and maybe it is actually a good idea, because currently we know what we deployed and when, but many times the work-items that are reopened and maybe it is interesting to see by cycle which work-items were new and which ones re-opened from a previous sprint/cycle.

I never participated in a SCRUM team so personally I'm not familiar with the tools they use. I know that there's probably nothing that prevents you from following this methodology using XPM but I do not know if there's anything that would facilitate its use that we don't do (i.e. A very important part of the SCRUM process is the backlog grooming, so maybe assign tasks to different team members depending on the type of task (marketing plan, test, functional-spec) is something that is very important for a SCRUM-tool and XPM does not have this ability. Currently XPM allows you to route tasks depending on the status (i.e. if the item has to be specified it goes to the team member that knows how to specify, if it has to be programmed it will go to the default developer, if it has to be tested to the default tester, etc .. and of course the defaults can be overruled).

I you are aware of features that a SCRUM tool 'must have' and you want to share that with us, we will be more than happy to consider them and if possible include them in our initial release

XPM & The Gaps

Harry: I have been thinking about how I can improve my own PM tasks, but I always end up needing a tool that is either unavailable or not cost-effective. I am hoping XPM can fill the gaps.

We felt the same way and that is why we were convinced that we needed to build our own tool.

The gaps that we experienced the most were the gaps between the methodology/concepts to the actual practice using the tools available. In the sense that currently our team members need to work and then go to QControl (our current issue tracking software) to record on that they worked (i.e. a developer programs an issue and then goes to QControl to change the status of the issue to indicate that it is completed, etc).

Everybody in our team reports hours in qControl but we do the value-analysis in MSProject so we need to export the hours-reported in qControl and enter it in MS-Project to be able to have status reports regarding the plan. We need to keep these two tools in synch so that MS-Projects has all the issues reported in XPM and so that XPM has all the dates/information that is calculated by MS-Projects.

We write specs in MS Word or in the wiki and then we manually indicate the link to the documentation in the issue. We have some information in qControl (the tracking notes) and some information in the documentation and sometimes we need to integrate or maintain both in synch.

There are lots of tools to do different parts of the work but no real integration to become one seamless task to you our daily job.

To improve our methodologies and manage better our projects we need information, but we needed to find a way so maintaining that information did not become more costly than the value of it. For that we needed to make it easy for every team member to provide the information.

We wanted for every member to provide all the information the team needs right from the place they spent most of their effort. If I'm a developer, I work on my KB, that is where I code, therefore right from there I should be able to see my task-list, to indicate when I’m done, commit my changes to others and from his effort the system should be smart enough to know which issue is ready, which objects were changed for that issue and how long it took (or at least suggest it). We were able to do all this in XPM thanks to the integration features in XML. The integration with Genexus and with the GXServer for us are one of the best features of XPM (even though you can use XPM to manage a team using other development tools, as you can use any issue-tracking tool).

A similar thing happens with the project managers. One of the main tasks of the project managers is to write requirements, specifications and other documents. So in this task there two main objectives combined write and share. Somehow it seems that those objectives are mutually exclusive. Great tools to write like Word are not very good for sharing and collaborating in documents. Tools like the wiki that are great for collaborating are not that great to write. So again integrating we want to have the best of both works. We want to be able in write in powerful word editor like MS Word but publish in tools like the wiki. So we are planning in adding the ability to 'wikify' a document automatically so you can write the documents in MS Word and let XPM “wikify it” by creating automatically the wiki-page (or pages) and link each work-item with its wiki-page.

Basically we want to integrate, coordinate and track all the work that we do from the place we are more comfortable in (or we spend most of our time). For sure there are more gaps that we want to bridge, and we hope to do so in the future (i.e. the process of going from design/diagrams to specs/work-items). Also in this regard we welcome any ideas that you might want to share :)