This is my first article on Flex. I thought my first article would be a simple “Hello World” type of example, but it is not to be. I had been trying to get a flex based WebServices client running on Flex and it had become a struggle. Fortunately “Google” came to my rescue and I have WebServices client up and running as a standalone application and also using LiveCycle Data Services(LCDS).
Developing a Flex WebService client
February 3, 2009 · 1 Comment
→ 1 CommentCategories: LCDS · flex · service · service oriented architecture · webservice
SOA – What are the different types of “services”?
December 14, 2008 · Leave a Comment
Welcome to the third part of the ongoing series of posts on Service Oriented Architecture(SOA). So far we have covered what SOA is and what do we understand by a service. Now let’s look at whether it is possible to categorize a “service“.
Keep reading →
→ Leave a CommentCategories: service oriented architecture · soa
Tagged: service oriented architecture, soa
Getting ICEFaces setup right!
December 14, 2008 · Leave a Comment
I have spent the last few days working on getting the ICEFaces set up right so that I could get some applications running on it. I had initially decided to create a post around the setup procedure, but fortunately I ran across this rigorous post on ICEFaces setup.
I am sharing the post with you.
→ Leave a CommentCategories: ICEFaces
SOA – What is a “service”?
October 12, 2008 · 1 Comment
This is in continuation to my previous post covering the basics of Service Oriented Architecture. Today I am going to cover what constitutes a “service”.
→ 1 CommentCategories: service · service oriented architecture
Tagged: service oriented architecture, soa
Deploying Google Web ToolKit Application on Tomcat
September 24, 2008 · 4 Comments
I was doing a small proof of concepts around the capabilities that Google Web Toolkit (GWT) provides in making the user interface richer. Doing the development of an application in GWT is a breeze. I could come a small RSS feed reader POC in a matter of 7-10 days. The next step was taking care of deployment on a web server. For all concerned I am using GWT for Windows version 1.5.2 and my tomcat version is 5.5. Tomcat deployment is also explained in GWT documentation here.
→ 4 CommentsCategories: GWT · Tomcat
Service Oriented Architecture (SOA)-An Introduction
September 3, 2008 · 1 Comment
In recent times, the term Service Oriented Architecture or the acroymn SOA has become a prominent buzzword in the IT landscape. The IT architecture has been in a constant state of evolution from the early monolithic mainframes, to client server, distributed component architecture and 3 to n tier architecture. The strategic IT vision began with complex object frameworks, moved on to touchy client-server systems, followed by simple three-tier architectures and ended up in a tangle of distributed computing.
→ 1 CommentCategories: service oriented architecture · soa
Getting Axis’s SOAPMonitor working and fixing AppletClassLoader’s NoClassFoundException
June 26, 2008 · 5 Comments
I was playing around with Axis2. Developing some POC type web services to understand the new capabilities that Axis has added in its armoury.
→ 5 CommentsCategories: AppletClassLoader · Axis2 · NoClassFoundException · Tomcat
Tagged: AppletClassLoader, Axis2, NoClassFoundException, Tomcat
Java Generics – An Introduction
April 17, 2008 · Leave a Comment
Java introduced generics in its Tiger release (5.0). It has been around for some time now. I was trying to understand the nittygritties of the feature when I came around an exhaustive text on generics by Angelika Langer. Although extremely exhaustive I would prefer a shorter version for my personal understanding. So here goes…..
One of the most popularly used features of the Java programming language is its Collections framework. However before Java 5 the Collections framework was hampered by a serious limitation. It did not provide the developer the ability to define the runtime type for a particular collection. Consider a requirement that a developer needs to hold a collection of strings. The collection class say ArrayList or Vector does not provide an ability to ensure that all objects added to the collection are of type String. This lead to poliferation of new user defined classes to ensure runtime type validation. Finally Java in its Tiger release provided a solution to this problem via the generics feature.
So how do you use generics. Here’s how you define a collection before Java 5.
List dogs = new ArrayList();
I want to ensure that the dogs list holds only Dog object. Here’s how you achieve the same via generics.
List<Dog> dogs = new ArrayList<Dog>();
The dogs list is now limited to acting as a container for Dog object instances and this is validated at runtime thus providing the elusive type safety checks. Now let’s play around with this feature.
//Package and import declarations have been removed for abbrevity.
1:public class Generics1Test {
2:
3: public static void main(String[] args) {
4: List<Dog> dogs = new ArrayList<Dog>();
5:
6: Dog dog = new Dog();
7: dogs.add(dog);
8:
9: Cat cat = new Cat();
10: dogs.add(cat);
}
}
class Animal {
}
class Dog extends Animal {
}
class Cat extends Animal {
}
Line 10 does not compile. Eclipse throws the following compilation error message:
The method add(Dog) in the type List<Dog> is not applicable for the arguments (Cat)
Let’s change the list a bit and make it contain animals instead of just dogs.
The list declaration of line 4 is changed to the following:
List<Animal> dogs = new ArrayList<Animal>();
Line 10 compiles without any errors.
Now let’s try some variations in the generic collection assignment.
1:public class Generics3Test {
2:
3: public static void main(String[] args) {
4:
5: List<Dog> dogs = new ArrayList<Dog>();
6: Collection<Dog> dogCollection = new ArrayList<Dog>();
7: List<Animal> animals = new ArrayList<Animal>();
8:
9: Dog dog1 = new Dog();
10: Dog dog2 = new Dog();
11: Cat cat1 = new Cat();
12:
13: dogs.add(dog1);
14: dogs.add(dog2);
15:
16: animals.add(dog1);
17: animals.add(dog2);
18: animals.add(cat1);
19:
20: dogCollection = dogs;
21: Dog dog3 = new Dog();
22: dogCollection.add(dog3);
23: //animals = dogs;
24: }
25
26:}
Upto line 18 we have not done anything out of the box. Line 20 does something special. It says that we can assign Collection<Dog> reference to List<Dog>. This means that as long as the generics paramater type (Dog) remains unchanged the raw type Collection can support its inheritance relationship. However vice-a-versa line 23 is not allowed. The following compilation error messages is thrown.
Type mismatch: cannot convert from List<Dog> to List<Animal>
For a better understanding of why this happens refer the following link (URL:http://www.angelikalanger.com/GenericsFAQ/FAQSections/ParameterizedTypes.html#What%20is%20a%20concrete%20instantiation?.
All the examples above used generic types made available as a part of the Java 5 release. It is also possible for us to define custom generic type. Here’s the sample:
public class KeyValuePair <K, V>{
private K key = null;
private V value = null;
public KeyValuePair(K k, V v) {
this.key = k;
this.value = v;
}
public K getKey() {
return this.key;
}
public V getValue() {
return this.value;
}
public void setValue(V val) {
this.value = val
}
}
Here’s a sample test client:
public class Generics4Test {
public static void main(String[] args) {
System.out.println("KEY: " + pair.getKey());
System.out.println("VALUE: " + pair.getValue());
pair.setValue(Long.valueOf(199));
KeyValuePair<String, Long> pair = new KeyValuePair<String, Long>("ONE", Long.valueOf(1));
System.out.println("VALUE: " + pair.getValue());
}
}
The output generated is
KEY: ONE
VALUE: 1
VALUE: 199
→ Leave a CommentCategories: Generics · Java · java generics
Tagged: Generics, Java, java generics
Accessing Windows Native API using Java
March 20, 2008 · 1 Comment
I was looking at alternatives besides JNI(Java Native Interface) to accessing Windows native API. Keep reading →
→ 1 CommentCategories: JNI
Tagged: Java, Java Native Access, Java Native Interface, JNA, JNative, JNI
Google Collections – An Overview with sample tutorials
January 15, 2008 · 2 Comments
One of the most commonly or widely used data structures within the Java language are the Collections. However time and again developers have felt the need for more flexibility
leading to the Apache Commons Collection library and now the Google Collections library.
There is already an article devoted to comparing the two libraries and I do not intend to take sides here. In this post I just intend to prepare certain easy-to-use reference examples for using the Google Collections library.
→ 2 CommentsCategories: Google Collections sample · Google Collections sample tutorial · Google Collections tutorial · google collections
Tagged: google collections, Google Collections tutorial