Thursday, March 25, 2010

Generating class, activity and use case diagrams on the fly

Sometimes you need to create UML diagrams quickly to show your ideas on your web page. To do it, you need to use a tool to create the diagram, then capture or export it, save as an image then upload somewhere before add it to the page. It's waste of time.

Now with yUML, you only need to write some text, YES - ONLY SOME TEXT, to generate UML diagrams on the fly without any special tools.

Example:

This text

[Customer]+1->*[Order]
[Order]++1-items >*[LineItem]
[Order]-0..1>[PaymentMethod]

will generate this class diagram


Currently, yUML supports class, activity and use case diagrams.

Activity diagram


Use case diagram

Saturday, March 20, 2010

Setting up a personal wiki

At office, we used wiki to share knowledge about projects and technical things. It's a good way to keep, organize and share the information. So I decided to install a wiki on my PC for personal usage.

Take a look around on open source wikis, I decided to install ScrewTurn Wiki on my PC (Windows 7). The reason I try it because it's included in Microsoft Web Platform Installer, so maybe it's good enough.

There are two ways to set up ScrewTurn Wiki: via Microsoft Web Platform Installer, and manually. I tried with Microsoft Web Platform Installer first because it's simpler way to install, just select and click a few options and buttons, and you should have something works. So I did it but had 500.19 error. Then I tried to set it up manually, but had the same problem.

Look into the error message and I finally found out that removing the whole 'configSections' section in web.config help to resolve the problem. Damn it, when there is an installer, I expect that after I click Finish, the software should be on and running.

Anyway, the wiki is running now and I will dig into it.

Thursday, March 18, 2010

Change data format in Ext JS's Template and XTemplate

Sometimes you want to change format of the data before showing it to your users, example: Change it to upper case, add '$' for USD,... Ext JS provides a few formatters and the good thing is you can use them in Template and XTemplate easily.

Example:

new Ext.XTemplate(
'',
'
',
'Full name: {firstName} {lastName}',
'Account identifier: {accountIdentifier:capitalize}',
'Balance: {balance:usMoney}'
'
'
'
'
)

As you see, 'capitalize' will change your data to upper case, and 'usMoney' will format your data as USD. Look nice and much simple.

Now maybe you will ask yourself 'But how can I add my own formatters?'. To answer this question, all you need to know that Template and XTemplate use Ext.util.Format internally to format your data.

So now, when you know it, it's very easy to add yourself formatters. I will add stripping zero formatter and so how to use it.

+ Add stripping zero formatter

Ext.util.Format.stripZero = function(v) {
while (v.startsWith('0')) {
v = v.substr(1, v.length - 1);
}

return v;
};

+ Use it

new Ext.XTemplate(
'',
'
',
'Number: {number:stripZero}',
'
'
'
'
)

Monday, March 08, 2010

How do you organize your build configurations?

I'm using TeamCity for the first project I tried to apply CI and I created build configurations as below:
  • Trunk
    Development build configuration, it will run if files are checked into trunk. No code coverage, no artifact, it should run as fast as it can
  • Nightly
    It will run nightly and produce code coverage and artifact
  • Release
    As its name, just for releasing. It also supports to deploy the release to remote server


How do you organize your build configurations?

Monday, March 01, 2010

Updating 2010 plan progress

I made a plan for 2010 and after 2 months I decided to update the progress. It will help me to keep on track and focus on what I planned.

  • TeamCity - In progress
  • ASP.NET MVC - In progress
  • ExtJS - Stopped, don't know when to resume
  • MSBuild - Stopped but maybe I will resume it next week
  • NHibernate - No progress
  • Castle ActiveRecord - No progress
  • Castle Windsor - No progress