Nicko think on software, web, ideas

June 5, 2007

Problems using 3rd party controls

Filed under: Code and Code, concept, think&think — Nicko Satria Utama @ 6:56 pm

Some forums said that I should use 3rd party controls to accelerate development process because of the reusable. It can be problems since I don’t know the controls works. I just know the features of the controls and using it. Some of them don’t have clear documentation and manuals.

Most of them claims the product best and complaint with some technology or other vendor controls. In fact they cannot claim 100% works. For examples the controls has feature of persistence and ajax / microsoft ajax technology. When they assemble into the HTML pages, There are many errors because of the javascript or callback.

To decrease the problem, use 3rd party controls wise.

Some controls is very expensive to buy although they have “sounds good” license like developer license, seat license. Some controls will open their source, but who has a time to analyze the source and add functionality their ? Wait for major or minor release ? Forget it. I have the job to finish quickly and deliver it to customer.

Using from the framework or base control is nice idea. We can do what we want like encapsulate or extending the functionality. It will come the price for time to develop the control to provide the features I want.

Using open source or free 3rd control is not bad.  Since sometimes it is not really free. Some features is not complete and maybe bugs. But we still can extending the functionality or repair bugs step by step.

May 5, 2007

Database and Business Object – why?

Filed under: concept — Nicko Satria Utama @ 10:58 am

Most programmer I know still confuse how to code well, especially they want to do with the data. They usually put some “accessing data” code on the UI like (on C#):

BtnGetOrder_Click(…) // some UI event
{

String connStr = “SomeConnectionString”;
String sqlStr = “SomeSqlString”;
SqlConnection connection = new SqlConnection(connStr);
connection.open();
SqlCommand command = new SqlCommand(sqlStr , connection);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())

{
// display result on the screen
}

}

The problem occurs when the UI changes, many codes changes too; and make the maintenance expensive. It is not easy to find a code and modify them when there are more than 200 line of codes in the methods. This styles usually use for quick samples or student.

Some forums or books suggest that it will use 1 or more classes contain many methods and properties for accessing data. UI methods just instantiate and using them. This style of coding technique is better so I can separate between UI and the logic. It might be a problem when I want to maintain the code or recreate/rebuild the code, I get million of code to find.

Business object offers more than just encapsulate methods and property into the class but give the meaning of the class. Most of business object is a representation of tables from database and the methods just manipulate its state. There are classes to handle saving, retrieving from database; and make relations between business object that represent relations in the table.

April 22, 2007

Step by step to learn into programming

Filed under: concept — Nicko Satria Utama @ 4:30 am

Many people around me always said computer is difficult thing to do. Especially when they want to learn how to programming. Here is a little step to learn. I don’t have to study to expensive university or course. Remember that the only purpose of programming is Solve the Problem.

First of all choose the operating system and platform to study. For easy way I use Windows and Visual Studio. I can use either C/C++, VB, C# or other language. Don’t forget to install MSDN as documentation or others. See the language reference for the syntax.

Then try to codes and show on the screen like hello world or something. Don’t worry it looks ugly. Try to understand on looping, branching, subprogram, integral type like what is integer, char or float; logic and a little about input/output. Don’t worry on object oriented mechanism like inheritence, type casting :) . Make a little code to solve a little problem.
Example :
I need a little program to get some data about party. The program can register who is attended and report it. The program can be done when user choose exit.

OK. The program is already built, but it strange that is only like that. So I want to add capabilities like sorting by name or searching by name. So I learn basic data structures like stack, queue and list/linkedlist, sorting (for easy way try to understand bubble sort) and search (just easy like binary search). I add the program above.
I need who is attended to be sort by name and I can search it by name.

Next steps I need to understand OOP. There are many books tells about it. I just take concept of inheritence, polymorphism, encapsulation, aggregation, composition, abstraction, class, object, method, and binding. The program above can be rewrite to many class that represent the object. The problem is what object do and what object can communicate each other. Just a simple example I have a class person that has attribute of name and a class of attender that inherit from person that has attribute like the attender is a family. The class need communicate to party class.

Next steps I can learn about building user interface for the someone who use the program. It is used as a input from user and output to user. The program can be redesign by just dropping some label, textbox, and button. I don’t need complex control now such as report control like crystal report or sql server report.

When the computer is shutdown, the data is gone; So I need to store the data. I learn a little about database. I can use many database software like simple MS Access or SQL Server; or I can use csv file (comma separated value). There are basic concept s of database need to be understood like table, field, record, domain/field type, view and basic sql syntax(create table, select without join, insert, update and delete) . I need connection string to connect from the program to database.

From here I can make a small program to solve the problem.

Blog at WordPress.com.