Introduction

Java is an object-oriented programming language developed by Sun Microsystems that has proven itself in numerous projects. The Java Platform is hardware and operating system independent and comes in three editions: Micro Edition for PDAs and cell phones; Standard Edition for computer programs; and Enterprise Edition for distributed, transactional, and portable applications.

Archive for the ‘Java’ Category

Tuesday, May 4th, 2004

AOP: Spring Framework

cheap cialis pill certified cialis cheap viagra in canada cialis buy drug buy generic cialis viagra buy 25mg viagra cheap viagra without prescription buy cheapest viagra on line purchase viagra cialis 10mg buying generic viagra cialis pills viagra from india cheapest sildenafil citrate cheap cialis no rx viagra india cialis bangkok viagra for order buy sildenafil internet buy generic viagra online buying cialis online where to order cialis tablet cialis find cialis no prescription required viagra cheap drug order cialis cheap online online pharmacy cialis cialis no rx order generic cialis price of cialis viagra soft drug viagra cheap viagra from uk order cialis no prescription order cheap viagra viagra drug order cheap cialis cheap cialis pharmacy best price for viagra cheap viagra from usa cost cialis cialis overnight shipping cheapest generic cialis online generic viagra online online viagra viagra sales cheap cialis in canada compare cialis prices online cialis online drug viagra online purchase discount cialis without prescription no rx viagra cialis overnight viagra uk cialis order cheap cialis from usa buying cialis cialis overnight delivery cialis in bangkok buy and purchase sildenafil online impotence treatment cheap price viagra viagra sale cheap cialis tablet drug cialis generic cialis online cheap viagra pharmacy find discount cialis online viagra malaysia cialis without a prescription buy cialis online cheap viagra rx buy no rx viagra cialis 20mg viagra in malaysia discount viagra online buy sildenafil cheap buy viagra low price buy cialis cialis cheap price cialis cheap generic viagra cialis canada low cost viagra buy cheap viagra cialis vs viagra order cialis from us cialis tablets find no rx cialis buy generic cialis online buy viagra overnight delivery cheapest cialis price buy cheapest cialis on line order cialis in canada viagra tablet viagra no online prescription find cheap cialis online viagra price order viagra no prescription cheap generic cialis buy viagra online cheap cialis uk cialis without rx generic cialis cheap viagra vs cialis order cialis on internet viagra tablets viagra purchase impotence drugs buy cialis generic cialis tablet cialis cheapest price order viagra from canada viagra generic cheap viagra from canada order cialis compare viagra prices online find cheap cialis impotence cure pfizer viagra find discount cialis cheapest cialis buy cialis from india impotence buy cheapest viagra online cialis side effects viagra order discount cialis online cialis in malaysia cialis in uk viagra in uk cialis online without prescription cialis online pharmacy order viagra buy viagra online viagra side effects cialis sale discount cialis no rx cheapest viagra find cialis order cialis no rx buy cialis low price buy viagra cheap drug cialis online purchase order discount viagra online 50 mg viagra 100 mg viagra 10mg cialis cost of cialis cheapest cialis prices buy discount viagra online cialis sales 50mg viagra cialis price buy viagra on internet cialis pill cheapest cialis online purchase viagra overnight delivery cheap cialis from canada cheapest viagra price cialis 20 mg buy sildenafil low cost order viagra without prescription buy viagra lowest price no prescription cialis order viagra on internet discount cialis overnight delivery cialis cheap drug viagra approved viagra no rx required compare viagra prices no rx cialis cheap cialis on internet buy viagra from india buy discount cialis online viagra pharmacy online order viagra from us cialis free delivery cialis for order buy cialis from canada viagra without rx viagra online review 10 mg cialis cheap viagra no rx cheapest viagra prices viagra prices cialis pharmacy order no rx cialis buy cialis in us buy cialis no prescription required order cialis from canada lowest price cialis cheap cialis internet online pharmacy viagra cheapest generic cialis generic drugs cialis india find cialis without prescription best price cialis buy viagra without prescription cheap cialis in uk where to buy viagra 20 mg cialis cheap cialis from uk buy sildenafil canada cialis no rx required cialis in us buy cialis overnight delivery cialis cheap price order cheap viagra online 20mg cialis buy cheap viagra online viagra internet viagra without prescription free cialis buy cialis us cialis buy buy viagra in canada order viagra cheap online find viagra without prescription viagra pills cheap cialis no prescription viagra online without prescription order generic viagra cialis discount viagra cheapest price purchase viagra no rx viagra no rx viagra cheap discount viagra overnight delivery sale cialis cialis pharmacy online purchase cialis without prescription pharmacy online cialis medication discount viagra buy cheap cialis impotence medication viagra medication find cialis on internet impotence pills cialis prices discount viagra without prescription cialis online cheap cialis online review find cheap viagra online buy viagra us purchase cialis online certified viagra where to order viagra buy cheapest viagra buy cialis internet order cialis online buy sildenafil online buy cialis cheap cheap viagra purchase cialis find discount viagra buy cialis on internet cialis buy online buy sildenafil online without a prescription viagra buy online order cheap cialis online viagra information no prescription viagra cost of viagra buy cialis in canada buy cialis online buy viagra cheapest generic viagra cialis us cialis australia fda approved cialis lowest price for viagra viagra bangkok cialis prescription cialis cost buy no rx cialis buy viagra internet viagra discount order viagra overnight delivery generic cialis viagra australia 25 mg viagra order viagra online viagra overnight cialis rx order cialis in us order viagra no rx order discount cialis online viagra vendors order viagra in us buy sildenafil in uk viagra us buy generic viagra viagra canada viagra no prescription viagra cheap price cheap viagra tablet viagra free delivery overnight viagra purchase viagra online find cheap viagra cialis malaysia best price viagra cialis free sample find viagra on internet cialis generic buy sildenafil in canada order cialis no prescription required cheapest viagra online purchase cialis no rx viagra in us order discount cialis cheap viagra internet free viagra cialis approved best price for cialis cialis from india find no rx viagra generic viagra viagra from canada viagra online pharmacy buy viagra from canada cheapest generic viagra online buy cheapest cialis discount cialis viagra overnight delivery cialis without prescription 100mg viagra cialis in australia price of viagra order cialis overnight delivery cheap viagra in uk buying generic cialis viagra pill buy cialis on line low cost cialis find discount viagra online buying viagra cheap cialis overnight delivery pharmacy cialis cheap viagra pill viagra prescription find viagra online buy cialis lowest price discount viagra no rx online cialis viagra free sample cheap viagra in usa find viagra cheap viagra online buy viagra no rx generic viagra cheap buy cialis without prescription buy viagra in us cheap viagra overnight delivery cheap cialis in usa cheap cialis online viagra order no rx viagra viagra soft tab find cialis online lowest price viagra cialis drug cialis vendors viagra online stores erectile dysfunction order viagra in canada buy viagra on line viagra overnight shipping viagra online cheap lowest price for cialis approved viagra pharmacy cialis 10 mg cialis no online prescription cialis purchase cialis from canada order cialis without prescription viagra for sale viagra in australia approved cialis pharmacy buy viagra generic buy sildenafil in spain find viagra no prescription required cialis no prescription buy viagra from us order viagra no prescription required cost viagra purchase viagra without prescription buy cialis no rx cialis cheap cialis internet tablet viagra cheap viagra on internet viagra cost pharmacy viagra cialis soft tab cialis information buy cheap cialis internet purchase cialis overnight delivery cheap cialis without prescription buy viagra no prescription required compare cialis prices buy cheap cialis online overnight cialis where to buy cialis cheap cialis buy cheap viagra internet buy discount cialis viagra buy drug cheap viagra no prescription buy sildenafil citrate buying viagra online buy discount viagra fda approved viagra cialis online stores cheap cialis tablets buy cheapest cialis online cheap viagra tablets order discount viagra sale viagra viagra online cialis for sale cialis soft viagra pharmacy buy cialis from us viagra without a prescription viagra in bangkok

I have recently been playing around with a layered Jave/J2EE framework called Spring. I came over a package called ‘aop’. That package really drew my attention on it. Thus I looked into a few classes that seemed to be the core one’s. It seems that they have built an AOP framework based on an open source project called AOP Alliance that provides the basic AOP constructs without the need of a special AOP language like AspectJ. They have done it using the Reflection API Java provides.
Given a similar API in Flash it would probably be possible to create a similar AOP framework for it. But that’s something I’m presently just dreaming about.
They have written a ‘little’ chapter on the aop framework called: Aspect Oriented Programming with Spring. I’d suggest you to refer to this article if you wanna learn more about it.

Monday, May 3rd, 2004

AOP: Kinded Pointcuts

We have already worked with kinded pointcuts in the examples of the previous posts. But I haven’t explicitly explained what different types of kinded pointcuts exist and which join points they exactly capture. Here’s a list of the kinded pointcuts AspectJ provides:

> execution(MethodSignature/ConstructorSignature):
As you have probably already imagined this will capture the method or constructor execution matching the signature.
> call(MethodSignature/ConstructorSignature):
Such a pointcut captures the calls to methods matching the signature.
> get(FieldSignature):
This pointcut will capture the retrieval of the value of a field matching the signature.
> set(FieldSignature):
This will capture the write access to a field matching the signature.
> handler(TypeSignature):
This will capture executions of exception handlers.

Examples:
call(public * MyClass.*())
This would capture all calls to all public methods in the class MyClass that do not take any arguments.

set(private float MyClass.myField)
This would capture write access to the private field myField of the class MyClass.

These are the most common pointcuts. There do also exist pointcuts to capture the Object initialization and pre-initialization and so forth. But I won’t show them here.

Friday, April 23rd, 2004

AOP: Wildcards

In the AOP examples I used in my previous posts I always captured exactly one join point with my pointcut. If you would always do it that way you had to define one pointcut for every join point. That is as you can probably imagine not effective. The real benefit comes then when you capture join points due to specific characteristics. For example you wanna capture every method in a specific class that throws an Exception. To do this you need wildcards.
AspectJ offers three wildcard notations:

- “+” indicates all subclasses or subinterfaces of a given type
- “..” indicates any number of charecters including all periods
- “*” indicates any number of characters excluding the period

You also have the negation operator “!” and the two operators “||” and “&&”.

Example:
public pointcut myPointcut() : execution(public * javax..*Model+.set*(*));

This would capture the execution of all public methods starting with set, taking one argument of any type, regardless of the return type that are defined in a class whose name ends with Model or any of its subclasses that reside in the javax package or any direct and indirect subpackages.

Funny … isn’t it?

Friday, April 16th, 2004

Interfaces

I was shocked when I read in a forum on Flash from a developer I really admire that he has never used interfaces as type definitions. He even asked if that really works. I just thought: “Huh! What’s going on?” Thus here a few thinks I learned about interfaces:

The Key Sentence:
Program to interfaces rather concrete implementations.

That’s the sentence you should always keep at the back of your mind while programming. Following this golden rule offers the following advantages:

1. Loose coupling between objects which promotes flexibility. You are not bound to concrete implementations. Thus you can change them easily when you have to without affecting calling code.
2. You can write simple stub implementations to ease the testing of classes. It also enables teams to work in parallel after they have agreed on interfaces.

Interfaces in Flash are sadly not that mature yet. There are a few problems related to working with them in practice. Martin and me came across them during the early days of the as2lib. He has summed them up in two posts on the as2lib blog: Interface Mistakes by Macromedia and :Object is Evil. But even with this limitations you should nevertheless work with interfaces because the advantages much outweigh the problems of them in Flash.
Read on to see interfaces in action.
(more…)

Friday, April 16th, 2004

AOP: Pointcuts

I covered the basics of AOP in my previous articles “AOP - Aspect Oriented Programming” and “AOP: Terms and AspectJ”. If you haven’t read them yet I’d suggest you to do this now. Otherwise just go on reading.
As I mentioned earlier pointcuts capture or identify join points. Named poincuts have the following syntax:

Syntax:
[access-specifier] pointcut pointcut-name([arguments]) : pointcut-type(signature)

Example:
public pointcut myPointcut() : execution(public void MyClass.myMethod())

You do use them in an advice as follows:

before() : myPointcut() {

}

Anonymous pointcuts are directly declared behind the “:”. It would then look like this:

before() : execution(public void MyClass.myMethod()) {

}

Well, that’s it for now. Easy, isn’t it? I will cover wildcards in my next article about AOP. And I hope that at the latest then you will recognize that AOP is a lot of fun. :)