Wednesday, April 23, 2008

Oracle for Beginner: ORDB with Oracle (III)

In this third part of my articles about ORDB with Oracle, I just want to share about a simple example of implementation ORDB in Oracle based on class diagram UML. I want to show you about how to implement aggregation, association and inheritance in Oracle. Here is the class diagram:


Segitiga and Lingkaran class are child class from Bidang class (as parent class). Bidang class has association relationship with Warna class. This association is one direction that means Bidang class has a Warna's type attribute. First, we have to create Warna class:

create type warna as object(
r number(3),
b number(3),
g number(3),
member function getWarna return varchar
);
/

create type body warna as
member function getWarna return varchar is
begin
return 'Red=' || to_char(self.r) || ', Blue=' || to_char(self.b) || ', Green=' || to_char(self.g);
end;
end;
/


Warna class has 3 attributes, i.e. r for Red, b for Blue and g for Green, and 1 operation that will return a varchar for the color. Now, we can create Bidang that will have an attribute as an object for Warna class.

create type Bidang as object(
x number(3),
y number(3),
color warna,
member function getLuas return number,
member function getKeliling return number
) not final;
/

create type body Bidang as
member function getLuas return number is
begin
return 0;
end;
member function getKeliling return number is
begin
return 0;
end;
end;
/


Tuesday, April 01, 2008

Oracle for Beginner: ORDB with Oracle (II)

Continuing my last note, here we will try to use VARRAY() to make multiple value for a attribute of table. One of disadvantage of varray is we have to specify the maximum of element array that we want to save in it.

Here an example of how to create a varray type:

SQL> create type v_pengajar_t as varray(3) of pengajar_t;

Like previous example, we can create table which have one attribute with varray() type.

SQL> create table vkursus(
2 no_kursus char(5) primary key,
3 nama varchar(30),
4 pengajar v_pengajar_t
5 );

To insert new data, we can use statement below:

SQL> insert into vkursus values ('X01', 'Oracle', v_pengajar_t(pengajar_t('P01', 'Budi'), pengajar_t('P02', 'Wati')));

1 row created.

SQL> insert into vkursus values ('X02', 'ORDB with Oracle', v_pengajar_t(pengajar_t('P01', 'Budi'), pengajar_t('P03', 'Othie'), pengajar_t('P04','Indah')));

1 row created.

SQL> commit;


To make a query for varray, we can use table() function to create a virtual table from varray field. Here is an example:

SQL> select no_kursus, v.nama, p.nama
2 from vkursus v, table(v.pengajar) p;

NO_KU NAMA NAMA
----- ------------------------------ ------------------------------
X01 Oracle Budi
X01 Oracle Wati
X02 ORDB with Oracle Budi
X02 ORDB with Oracle Othie
X02 ORDB with Oracle Indah

Thursday, March 27, 2008

Oracle for Beginner: ORDB with Oracle (I)

If you want to learn about object relational database in Oracle, the first thing that you have to understand is object oriented concept itself. By the way, in what level of your understanding, let we learn about how to implement a simple Oracle's ORBMS.
In Oracle, there are object schema, .i.e., User Define Type (UDT). With this object, we can create any customize type, specially object type. Here is a example:

create or replace type pengajar_t as object (
pengajar_id char(5),
nama varchar(30)
)
/

With customize object type, we can use that as a attribute type for a table.

create table kursus (
kursus_id char(5) primary key,
nama_kursus varchar(50),
pengajar pengajar_t
);

If you want to insert or update for that table, here are an example for how to do that:

insert into kursus values ('K01', 'Air Blender', pengajar_t('X-01','Avatar'));
insert into kursus values ('K02', 'Kamehameha', pengajar_t('X-02','Goku'));
update kursus k set k.pengajar.nama = 'Gohan' where k.pengajar.pengajar_id ='X-02';

Sunday, March 23, 2008

OpenSource style for marketing

As you know, Open Source movement have changed the world to make their policies, either for organization or ourself. With this movement, everyone can became a programmer, a documentation maintainer, a tester, or may be only as a end user. I interested about how to make community, like Open Source, to make a marketing more powerful. With involving our customers, I believe that they will give their ideas (like wish list) to make our organization can give services better. I talk this with my client that one important thing to make their business can get the trust from their customers or partners is to make a good relationship with them. This is why CRM or PRM (Partner Relationship Management) concept arise on the surface.
How to build a customer community for our organization? Of course the most important thing to realize that is we have to give the best of our service to our partners. After that, we can use the Internet service to capture our customer requirements or needs. Indirectly, if our partner community is strong, they will promote our organization to others. This is a good strategy. And I believe that almost marketing manager had realize this way. But in Indonesia, specially for small-medium enterprise, still don't figure out about this. The big problem is the Internet penetration still low. Based on the APJII data, the Internet users in Indonesia at the end of 2005 was estimated around 1.6 million (I thing from 200 million population :D). I thing, we have to build and maintain many communities to develop their local small-business enterprise area to realize the Internet. Many names have arisen , like Internet goes to Village. I still figure out about the cheaper Internet access from villages. May be we can use mess wireless protocol to build local wireless communication with WiFi. Who knows...

Tuesday, February 12, 2008

Make My Desktop more fancy

I use fedora core 7 with Gnome and Beryl as the desktop management. To make my Beryl Desktop more fancy, I installed Mac4Lin Emerald Theme. This theme really make me more exciting to use Linux Desktop as my operating system in my notebook. To make my Linux Desktop to become most like a Tiger Mac X OS, I installed Avant Window Navigator too. With Avant, I have a fancy launch pad like Mac X OS in my Desktop. Very impressive.

In another thing, in my Linux box, I have installed VMWare Player that playing M$ Windows XP Home Edition (provided by compaq presario V1000 bundled) with SP2 for me. (I have tried VirtualBox to play Fedora Core 8). For my virtual M$ Windows, I want to make the desktop more like Fedora too, so I installed Fedora Transformation Packet. I think this theme is very impressive for my windows.

Here is the example of my desktop with Mac4Lin and Avant :

Monday, February 11, 2008

My Favorite mobile IM

At the first time when I changed my phone cell to N73, I have tried to fine a better IM application. First of all, I use mig33 (http://www.mig33.com) . But after a week, I didn't convenient with that. So, I tried to use shMessenger (http://www.shmessenger.ro/lang_en/index.jsp). This is a good mobile IM application, but unfortunately that application only support Yahoo! IM. I want to use an application with multiple IM protocol. Then, I found fring (http://www.fring.com). With early fring, I can use GTalk protocol, SIP, Fring, ICQ, but there were no Y! IM. But with the newest fring version (3.30), this application make me happy because they already support Y! IM protocol. So.. fring is the best mobile IM application for me. Right now. :D

Today (the day after I wrote this article), my friend has told me about another better Mobile IM application, i.e. Nimbuzz. Nimbuzz is j2me based application that support multi IM protocol and facebook. I have installed too and want to try it, may be this application can change my favorite, i.e. fring. Let me see...

After almost 2 months, I have decided to use Nimbuzz as my mobile messenger applications. :D Sorry fring.