Archive

Monthly Archives: December 2007

Developing Ajax-based Java applications

ABSTRACT:

This Tech Talk provides an overview of the ICEfaces framework, which is designed to add AJAX to JSF based on a technology called Direct-to-DOM Rendering. This approach allows a web application to be rendered entirely on the server side. The browser essentially acts as a remote control to a server-side rendering of the DOM – making the AJAX capabilities transparent to the developer. Developers can work in a pure JSF programming model, have no exposure to JavaScript development or any of the low-level intricacies of AJAX and still get the full rich web capability.

Want to run Google Talk with multiple Gmail identities?If you have several Google Gmail accounts you also may want to run multiple instances of Google Talk. This is especially important for families that share a single PC. Nothing worse than a family member signing you out so they can sign in under their own account!Basically, to have “Google Polygamy” you need to run Google Talk with the following switch: /nomutexStep 1: Right-click on the desktop

Step 2: Select NewStep

Step 3: Select ShortcutStep

Step 4: Paste this into the text box:”c:\program files\google\google talk\googletalk.exe” /nomutex

Step 5: Click Next and choose a shortcut name such as Google Talk1, Google Talk2, or something related to your Gmail account for easy remembering which account is which.

Step 6: Click OK a few times.

With the increasing adoption of Web services and Service-Oriented Architectures (SOAs), ensuring the authenticity, integrity, and nonrepudiability of XML messages has become an essential component of secure and robust messaging infrastructures. Using a sample scenario, this article walks you through how to use Apache WSS4J and IBM® WebSphere® DataPower® SOA Appliances together to enable the signing and verification of XML documents.

Reference

What are Traits?Traits are like interfaces, but can have a method body and a class that implements a Trait inherits the method body. In many ways Traits are similar to abstract classes, but they don’t have constructors, don’t have initializers, don’t have fields, can be multiply inherited (like an interface), and super does not refer to a method in an inherited trait, instead of super you have to qualify the intended name [TraitName].[methodName]( … ).By way of example consider current best practice: you write an interface, e.g. List, write a useful abstract class to make writing lists easier, AbstractList, and then implement some lists, e.g. ArrayList. This is all well and good, but suppose you now want to add some extra methods to List, e.g. sort. You can’t because every class that implements List would need to add a sort method and you don’t have control over all the source that uses List. So instead you use a helper class, Collections, and add sort as a static method. The user then calls sort( list ) (assuming a static import is used). A better technique is a Trait, with a trait you modify List:

public interface List extends Collection {

void sort() { … } // same syntax as an interface but allows method bodies

}

ArrayList now automatically pick up sort and the user does not need a special import, instead just like any other instance method the user writes list.sort().

Details

With Traits, if there is a conflict due to multiple inheritance then you have to resolve this conflict (this is a key difference from Mixins – see below). E.G.:

interface X { int m() { return 1; } }

interface Y { int m() { return 2; } }

interface Z extends X { int m() { return 3; } }

class XY implements X, Y { // conflict – 2 m’s

public int m() { return X.m(); } // resolve conflict

}

class XZ implements X, Z {} // no conflict – Z’s m overrides X’s

Note on Mixins

The difference between a Trait and a Mixin is that order is important. In the class XY example given above, with a Trait you have to explicitly say which m you want. With a Mixin the order in which the interfaces are mixed in determines what happens. class XY implements X, Y {} is read as first mixing in X then mixing in Y; hence the m from Y overrides the m from X, since it is mixed in afterwards.

Note on Extension Methods

An alternative way of adding methods to a class is Extension Methods, these are proposed for Java 7, but have a number of problems.

Extending existing classes

To be able to add methods to an interface without recompiling, all clients of the interface, the class loader has to be extended to automatically add in the extra methods if they are not present and to flag an error if an unresolved conflict exists. Currently the class loader flags a missing method, the required extra action would be to see if the missing method is in an implemented interface and if it can be added without conflict.

As an alternative to abstract classes

Traits would be a viable alternative to abstract classes in many cases, for example the methods in AbstractCollection could be moved to Collectionand no one would need to use AbstractCollection in the future. But a Trait cannot have any fields, therefore some abstract classes, e.g. AbstractList (it contains a field) would still be needed, although some methods may be moved to an interface.

Reference

 

Supporting Java Traits in Eclipse

 

 

 

 

 

Have you been submitting resumes and not hearing back? A piece on dice.com suggests it may not be your lack of qualifications but more of a lack of keywords.

Keywords are phrases that communicate your job skills, responsibilities, and/or functions. The more you reference keywords that are contained in the recruiter’s search, the more likely you’ll get calls. Here’s some advice from dice.com:

First, be aware that keywords are best when they refer to hard skills. In other words, “network engineer” and “Help Desk agent” are likely to get more direct attention than “team player” or “multi-tasker.”

The physical location of keywords is also important. Dice says, “Providing a summary of keywords at the conclusion of your resume is an effective way to assure that your resume is selected during database searches. However, to help move you to the interviewing stage, list your keywords near the top.” Deborah Walker, a certified career coach and president of Alpha Advantage in Portland, Oregon, suggests including keywords in the top four to five inches of your resume because the recruiter won’t look beyond that when quickly reviewing a batch of candidate resumes.

And another little tip from the same article: If you’re changing careers and don’t have the relevant experience yet that would allow you to incorporate the keywords, you can include an “objective” that includes a list of skills you want to develop. That way, your resume will come up in keyword searches.

Ref: TechRepublic