If you see clouds …

There are 3 different type of cloud implementations that can be adopted by a company :

1. Private clouds. This type of clouds is the most expensive one in terms of implementation, since everything must be provided and maintained by  everything by the company. The good side of it is TOTAL CONTROL. The company can design the cloud as they see fit, and also it won’t have to worry about the data contained in the cloud. For example, some companies and institutions by its nature and regulations won’t allow their data travel to someone else’ machine no matter what.

2. Public clouds. This type of clouds is the opposite of private clouds. All kinds of services, be it infrastructure, platform, service, or business process, is offered in this type of clouds. Although this type is the most expensive one in terms of maintenance, public clouds are the fastest way one can setup business with. Things a company should consider is the nature of data they are about to put in the clouds and the readiness of the software they are about to run in the cloud. While the data needs to met the legal and regulatory prerequisites, the software need to be at least a Software as a Service compliant.

3. Hybrid clouds. This type of clouds is harnessing the other two advantages. But of course there should be a standardized way to communicate between public clouds and private clouds.

Advertisements

Looking at enterprise applications …

Lately i’ve been playing with some applications that supposedly utilized in enterprise scale business. There are some good points they have that i still miss in my daily coding work.

1. Message coding.

Big applications tends to have an organized structure of message code. Its like

[ADM0021] Error occured while setting user role.

Perhaps it needs more effort, but debugging such error should be much easier especially when the error is found by the users which, in some cases, is located somewhere far from us. Beside, it would be easier to document the error so that user can actually solve the problem themselves.

2. Software development management and stuffs

Documents such as software requirements, design, and change management are examples of things we need to NEGOTIATE. Without those, you’re going to have a prolonged projects with everchanging requirements. Other documents such as diagrams are needed to make your projects LOOK SOPHISTICATED. Stupid it is, but important.

3. Versioning

Do you ever make a folder in your desktop named “trash” and put everything in it in every month ? Versioning make it easy to put our work in an orderly manner, plus an option to return when we actually made stupid mistakes.

 

First step toward OpenLDAP

After getting some revelation from the Big Bro, I finally able to create my own entry 😀

Here’s a few things to do :

  1. Do some config here and there
    Here we have to edit ldap.conf and slapd.conf in /etc/openldap.
    In ldap.conf, we modify URI to point to our LDAP server and Base to point to the root of our LDAP structure. Usually the base is like this

    Base dc=Example, dc=com

    In slapd.conf, we modify the database (we use bdb), suffix (same with the base in ldap), rootdn (in the example they use cn=manager, so the entry would be like this

    rootdn "cn=manager,  dc=Example, dc=com"

    rootpw is the password for the rootdn, mind the password-hash. Read man slapd.conf to know more about the password-hash

  2. Create an .ldif file (Mine looks like this, except I only used one dc. Forgive me if this one is inaccurate)

    dn: o=Example Indonesia, dc=Example, dc=com
    objectClass: top
    objectClass: organization
    o: Example Indonesia
    dc: Example

    dn: ou=Vendor, o=Example Indonesia, dc=Example, dc=com
    objectClass: top
    objectClass: organizationalUnit
    ou: Vendor
    description: project vendor

    dn: uid=baca, ou=Vendor, o=Example Indonesia, dc=Example, dc=com
    objectClass: top
    objectClass: person
    objectClass: organizationalPerson
    objectClass: inetOrgPerson
    cn: Suka Mbaca
    sn: Mbaca
    givenName: Suka
    ou: Vendor
    uid: baca
    mail: sampah@email.com

    this will create user baca under unit Vendor in organization Example Indonesia. We follow basic schema built in openldap. Custom schema can be added by creating .schema files.

  3. run ldapadd -x -D "cn=manager,dc=example,dc=com" -W -f example.ldif
    Example.ldif is the .ldif file we created earlier. The command will add those entries in the file to the ldap.

New Office, New Toys

It’s been 2 weeks since i moved to the new office. Well, of course it has a lot of brand new toys. Here we have Red Hat Enterprise Linux, Liferay Portal, Zimbra Mail Server, and Jabberd … all connected (to be) by OpenLDAP.

OK, here’s today catch :

In order to install Jabberd-2.2.4, we need to install gnu sasl newer than 0.2.27. I was fooled by the ordering in the site and downloaded 0.2.9, which is older than 0.2.27. Then I decided to install 0.2.27. Here I learned that in order to remove the old installation done by make install we can use make uninstall (if the installer is still intact) .

After I installed it, I find that the error we found from ./configure command in jabberd still persist. Random search at google i found this link http://jabberd2.xiaoka.com/ticket/133. Here I learned that sometimes for a library to work, we have to modify ld.so.conf to include the library and ldconfig to update the links of the library.

Ganymede ’round the world huh

Yea,

After a long days waiting for the new release of Eclipse, finally Ganymede is available. Hastily, I put all of my download capacity toward it. And as always, I hastily put it into the ongoing project i’ve been working on. So now that there is Ganymede Around the World Contest, i finally able to scream what I dislike about the project.

1. cannot create a Tomcat 6.0 server

2. cannot create a Tomcat 6.0 server

3. cannot create a Tomcat 6.0 server

.

.

Gaah … I really wonder why, since even the 3.4 Ms is doing okay on that part…

When you stuck upon Eclipse

Based on my experience, there is only two things you can do when you stuck upon Eclipse :

  1. Keep searching
  2. Wait for the next update to be released.

Eclipse is still growing after all …

powered by performancing firefox

Action or Handler

When I code using swing, I used to wrote the controller part of the MVC in Action classes. So, when I code in eclipse RCP, I wrote it also in Action classes.

I was wrong.

The code was fine until the program need to get the result of the business process operations. The Action class in eclipse RCP doesn’t return anything. After I searched the answer for two whole days, I found that there is a plugin called org.eclipse.core.command. The Action classes I was using is commonly used for handling events in a view’s menus. The Eclipse use command design pattern.

In command design pattern, there is a command, the invoker, and the handler of commands. The invoker is the view, which then issues commands, and the commands appoint which handler is supposed to handle the command.

In short, this is what happened after I changed my program :

View -> command registry -> command, and states -> handler -> business process -> handler -> View

And thats it. The handlers is able to return values using state.

How about the Action classes I mentioned earlier ?

The Action class is able to use the Command class to do the task. Then you can put the Action class in menus.

powered by performancing firefox

Introducing Eclipse RCP

One day near the deadline, a project teammate asked me about Eclipse RCP; something I used from the beginning of the project. I don’t have the 100% correct answer, but in my opinion, a Rich Client Platform is a platform we can use to simplify desktop client application development. All tedious things we frequently wrote, such as dialogs, wizards, preferences, help systems, up to update management is provided there in a good structure.

Eclipse RCP is one of them.

powered by performancing firefox

Listener styles

I remembered the first time I wrote a desktop form using java. I wrote everything inside a class, including the listeners, and the whole business process involving database access, data manipulation and so on. I didn’t realized that it’s a worst thing to do until my code gone beyond 1000 lines.

Picked a lesson from that, I begin to separate business process, data models, and user interface into something they called MVC. Upon trial and error, I came into a few style to create a desktop form:

  1. A view with one or more listeners as controllers.
  2. A view with one or more action classes as controllers connected by anonymous listeners.
  3. A view with one or more action classes as controllers accessed by private methods connected by listeners.

The first style looks like this :

Button a = new Button();
a.addListener(new AListener());

.
.
class AListener extends SelectionAdapter
{
    //extends methods and do all business process here
}

I found this style not flexible because in a large application, you might want to create more than one way to do something. A simple example is creating a button and a menu item to do the exact thing.

The second style looks like this :

Button a = new Button();
a.addListener(new Listener()
{
    AnAction x = new AnAction();
    x.run();
};

.
.
class An Action extends Action()
{
    public void run()
    {
       //do business process here
    }
}

I think this style is better than the first one, since the style allows me to put the action in any listener. But it still has a problem. Sometimes we want to modify the content of form element, say, a text field, or variable upon doing the business process. Our code become ugly because we have to put final keyword to variables we need to access inside the Listener class.

So, in order to cure the problem, I used this style :

Button a = new Button();
a.addListener(new Listener()
{
    doThings();
};

//we can access variables without using final keyword
private void doThings()
{
    AnAction x = new AnAction();
    x.run();  
}
.
.
class An Action extends Action()
{
    public void run()
    {
       //do business process here
    }
}

I think the last style is the best so far.

powered by performancing firefox

Installing things

Okay, what I need to do is get some files including the installer from firebird official website and start installing. The installation is a smooth sailing process since the installer is already in executable form.

Now the bird is already installed, the next step would be creating a database instance. Since I hate to use firebird’s console, I started to look for an RDBMS. Fortunately from following the links in firebird official website I find a great RDBMS tool called IBExpert. The tool’s personal edition is free. Beware though, you have to commit transactions you made on it, since I spent hours to figure what’s wrong in my java program only to find the dummy data I inserted into the database hasn’t been commited.

Back to database creation, it’s easy to do that with the tool. But one thing that surprised me. The database is a single file, and we have to include it’s path in our connection string. How carefree …, but I think it’s easy to switch between dummy databases in development environment.

powered by performancing firefox