Archive for January, 2008

Web Service Mocking Tool »

I have a WSDL file received from 3rd party. I generate the client code but the server is not ready yet. So how do I test my code ? There are times that we need to test Web Service client that we have written by mocking up the Web Service response. There are many Web […]

Storing Phone Number in Mobile Phone »

Have you ever noticed or aware of the ‘+’ sign that is prefixed in the phone number that we dial or store in the address book in our mobile phone? What is the significance of putting a ‘+’ sign in front? All the telephone numbers we dial follow certain format known as E.164 addressing format […]

Java Notes »

Reading a large file Reference Java 1000 tips ebook free download Download Here

Oracle Compress Table Problem ? »

An interesting finding… create table test_table ( col_1 number ) compress; alter table test_table add (col_2 number); insert into test_table values(1,2); After this, try to drop one column alter table test_table drop column col_2; ORA-39726: unsupported add/drop column operation on compressed tables This is expected as the table is still compressed. alter table test_table nocompress; […]

Oracle AWR and ADDM for Performance Tuning »

Oracle AWR (Advanced Workload Repository) and ADDM (Automated Database Diagnostic Monitor) which are available since Oracle 10g are useful features for performance tuning and troubleshooting. For developer like me who uses Oracle but is not a Oracle dba both AWR and ADDM are useful when I need to troubleshoot for performance related issues related to […]

Visual Paradigm for UML Community Edition »

Visual Paradigm for UML Community Edition is a UML modeling platform. The community edition is quite useful but lacking a lot of features which are only available in the Enterprise edition.

Java VarArgs – An Overlooked Feature »

I think VarArgs feature available since JDK1.5 is often overlooked by developer. It is handly when you want to pass multiple arguments of the same types to a function. E.g. public class TestArgs { public void print(String… text){ for (String val:text){ System.out.println(val); } } public static void main(String args[]){ TestArgs arg = new TestArgs(); arg.print(“testing”); […]

Design Pattern in Java 101 – Command Pattern (Behavioral Pattern) »

Download Sample Code A Command pattern is an object behavioral pattern that allows us to achieve complete decoupling between the sender and the receiver. It allows you to encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests. Here is a rewrite of the C# example provided […] DBDesigner – A Handy MySQL Database Designer »

DBDesigner is the tool that I used for MySQL database design, modeling and creation. I have used other tools but found DBDesigner being the simplest to use, at least for me. DBDesigner is developed and optimized for the open source MySQL-Database to support MySQL users with a powerful and free available design tool. Features list […]

Design Pattern in Java 101 – Lazy Load Part II »

Download Sample Code This is Part II of the previously described Lazy Load pattern. value holder A value holder is used as a generic Lazy Load. It is an object that wraps some other object. To get the underlying object you ask the value holder for the value, and the first access will pull the […]

Design Pattern in Java 101 – Lazy Load Part I »

Download Sample Code Lazy Load is one of the object relational behavioral patterns. With lazy load, an object does not contain all of the data you need but knows how to get it when it is needed. This pattern is commonly found in most of the OR mappers, e.g. Hibernate. E.g. when you load the […]

Apache Axis or CXF ? »

Both Axis and CXF are now under the umbrella of Apache now, and both of them are web services framework. So which one to choose for web services development? One good article for reference can be found here. Personally I have tested and used both frameworks and I would agree that both frameworks behave very […]

Open Source Object Databases »

db4o and Prevayler are 2 object databases that I tested recently. db4o is the open source object database that enables Java and .NET developers to store and retrieve any application object with only one line of code, eliminating the need to predefine or maintain a separate, rigid data model. Prevayler is an object persistence library […]

Design Pattern in .NET 101 – Factory Method Pattern (Creational Pattern) »

Download Sample Code Factory Method Pattern defines an interface for creating an object, but let subclasses decide which class to instantiate. It lets a class defer instantiation to subclasses. E.g., I defined a abstract News class. using System; using System.Collections.Generic; using System.Text; namespace FactoryPattern { abstract class News { } } Different kinds of news […]

Design Pattern in .NET 101 – Facade Pattern (Structural Pattern) »

Download Sample Code Facade Pattern provides a unified interface to a set of interfaces in a subsystem. It defines a higher-level interface that makes the subsystem easier to use. E.g. I have a Call Details Record (CDR) to be processed by different systems. It is defined in the CDR class using System; using System.Collections.Generic; using […]

Design Pattern in .NET 101 – Decorator Pattern (Structural Pattern) »

Download Sample Code Decorator Pattern attaches additional responsibilities to an object dynamically and provides a flexible alternative to subclassing for extending functionality. E.g. BaseMessage is defined using System; using System.Collections.Generic; using System.Text; namespace DecoratorPattern { abstract class BaseMessage { private string sender; private string recipient; public string Sender { get { return this.sender; } set […]

Oracle Notes »

ORA-14402: updating partition key column would cause a partition change Solution: Run alter table <table name> enable row movement Reference Locking or Unlocking Statistics Use the following procedures to lock and unlock statistics on objects. LOCK_SCHEMA_STATS Procedure LOCK_TABLE_STATS Procedure UNLOCK_SCHEMA_STATS Procedure UNLOCK_TABLE_STATS Procedure Reference In Oracle 10g the DBMS_JOB package is replaced by the DBMS_SCHEDULER […]

Console – A Better Windows Console »

Console is an enhancement of the normal Windows console. Try it and you will like it !!

Design Pattern in .NET 101 – Proxy Pattern (Structural Pattern) »

Download Sample Code Proxy Pattern provides a surrogate or placeholder for another object to control access to it. E.g. I defined a IGreeting interface using System; using System.Collections.Generic; using System.Text; namespace ProxyPattern { interface IGreeting { void SayHello(); } } Greeting implements IGreeting using System; using System.Collections.Generic; using System.Text; namespace ProxyPattern { class Greeting: IGreeting […]

Apache Commons Lang Part I – String Functions »

Download Sample Code Apache Commons Lang provides very generic, very reusable components for everyday use. String manipulation – StringUtils, StringEscapeUtils, RandomStringUtils, Tokenizer, WordUtils. StringUtils operations are null safe. As taken from the documentation, IsEmpty/IsBlank – checks if a String contains text Trim/Strip – removes leading and trailing whitespace Equals – compares two strings null-safe IndexOf/LastIndexOf/Contains […]