mercredi, décembre 30, 2009

ExtJS: Structuring your javascript code (1)

ExtJS and me ;)

In my search for good client application widgets, a few years ago, I started to look at YahooUI.
In these days ("days of yore" would be a tad inappropriate ;) ), YahooUI had some limitations, and only a few "out-of-the-box" widgets for "enterprise" applications.

The following is an approximated history of ExtJS, don't take it for granted... :p

At some point, Jack Slocum forked or bundled, or rewrote a whole lot of YahooUI, known in these days as YahooUI-ext (extension).
This is when I learned about it, thanks to my soon-to-be boss (javascript hacker in his spare time ;)).
Though as the project evolved, and the codebase got almost completely rewritten, the project began to include YahooUI as one of its core mechanims (and therefore YahooUI-Ext was not only an extension to YahooUI anymore), which was the major shift that made the renamed ExtJS a framework in its own right. From now on, YahooUI dependency could be completely removed, and other frameworks could be used as an core mechanism (JQuery, Prototype...).

At some point (version 2.0 and on) a specifically rewritten and optimized extjs mechanism was made available: ext-base. From there on, other frameworks were not even necessary anymore.

Javascript thingy... why OMG why???


In a few previous posts, I've already tried to debunk the javascript monster, in order to show that Javascript is a very good language, and that the monster in the browser is not javascript itself (though as every language, it's far from perfect), but the DOM one has to deal with (which differs from browser to browser).

As a web era guy, I've always felt deeply uncomfortable coding web interfaces with server-side languages (even if they are for rich-client-like applications). It has always made me feel like playing volley-ball knee-deep in liquid honey... (ok this is a weird image, though it conveys the message I guess).

In fact, HTTP is a disconnected protocol, and I've always felt like one should use the best tool on both sides.
Before a few years ago and the dawning of AJAX, the client side was in a "ask-for-page, display-page, submit-form" paradigm which made server-side handling of web sites still relevant.
With AJAX and modern frameworks like ExtJS, it is possible to build your client application with a notepad in an html file, and then provide a backend based on any technology you see fit: JavaEE, .Net, PHP, CGI...
Moreover, if you need to change the UI or refresh it a bit later on, you will have the opportunity to do it without touching the logic-handling backend.

I know for a fact that this ranting is directly (in my case) directed towards frameworks like JSF or GWT (the later being a specific case, as all it does is allowing you to code javascript + HTML + CSS in Java, and also because I think it's a damn good framework).

There are 2 tasks one has to handle with a javascript based framework like ExtJS (in fact 3, because the first is to know a bit more than average about Javascript) in order to achieve productivity:
  1. Use an appropriate tooling: Javascript is not compiled, a validation tool is then required (and code completion is a nice-to-have)
  2. Try to structure your code properly: This is (sadly) not very much documented.

I'll try to detail the second point in this post. For the first one, I'd recommend the use of Aptana, TextMate, or Spket in Eclipse. Visual Studio seems to have some Intellisense features for ExtJS. Learn more here.

The need to structure

When you download ExtJS, you receive a whole lot of good stuff. Among these a lot of examples...

What is hard to do is to try and begin an application.
Very quickly, you'll end up creating a grid, and asking yourself: "My Ajax server-side request seems to be called and returns JSON/XML, then why is it that my grid doesn't show the records?".
You'll soon see that extending the default stores and readers will allow you to whether use browsers' consoles (when they have one) or message boxes in order to give feedback on potential errors.
By default, the framework's widgets are quite silent about this.

Though all the hooks are in place, allowing you to add the expected behaviour (e.g. a popup when server-side errors occur, or even a retry policy, or displaying a loading icon...).

In order to achieve and more importantly maintain that, a bit of structure is necessary.
This is what I'll try and demonstrate in my next blog post.

lundi, août 10, 2009

Mule will do the hard work, I'll do the reading

http://ddossot.blogspot.com/2009/07/mule-in-action-now-treeware.html
Mule in Action has been out for a while now, though as I don't live overseas (well...depends from the point of view... or not... ;) ) it took a bit of time before I received my order.

I'm now the very glad owner of a "Mule in action" book.

I can only recommend it to anybody wanting to deal with the donkey beast.
It is fully packed with ESBntegration knowledge, from basic to very technical details!

Everything you should know about Mule 2.x is in this book.

Very good work from the very brilliant David and John!

Go and order it!

samedi, juin 27, 2009

Jazoon Day 1: Open UAT (Universal Authentication Toolkit) for devices

Out of Band (OOB) Channels


Visual channel (barcodes)
Audio channel (key encoded by audio)
Manual string comparison (comparing codes)
Accelerometer data (devices shaken together)
Button presses (buttons pressed at the same time)

J2ME Polish


Nice tool to specify the target of the build

ScreenSnap


In-device capture application for Java ME

This Open UAT system would be interesting on Google Android for example...

Jazoon Day 1: Rules engines overview and case study

Motivation for the use of business rules


updates in business rules have to change overnight

Core idea


Treat business logic as business data

BRMS (Business Rules Management System)

BOM vs XOM


Business Object Model vs Execution Object Model

iLog vs Drools
equivalence of features.

Business Rules format
when

then


Advanced Features


Custom, Higher level business language (translated to the same rules behind the scene
Rule security

Rules engine and SOA


Used for Monitoring of SLA

Rules engine and CEP (Complex Event Processing)


Almost all BRMS have a CEP engine (well to me it seems a bit weird to say that... all engines have it, so it must be useful... :p )

A bit of feedback on 2 projects with iLog and CLIPS.

Jazoon Day 1: Maven 3.x, Tycho

Lots of attendees!!

Maven 3.0


Fewer modules
Simpler codebase
Better IDEs support
Integration Testing
Backward compatibility

Pom in multiple formats (groovy, ruby)

PluginManager externalized

Queryable lifecycle


Execution plan is defined up front and depending on the environment, what it will execute will be different (compilation with JDT In Eclipse for example)

Plugin Extension Points, Lifecycle Extension Points

Error & Integrity reporting fixed

Mercury


async http client with ssl and streaming PGP, WebDav.
Designed as standalone, Mercury can be embedded
SAT4J (pseudo boolean solver) for dependency resolution

Guice + Peaberry


Plexus will be replaced
Peaberry is the equivalent of Spring dm for Guice


Incremental build support

Extensible reporting

M2Eclipse


Lots of real improvements with Maven 3.0
M2E configuration framework
Real round-trip between Eclipse and Maven Pom! NICE!!!!

Planned for September/October... can't wait... in fact, maybe I won't ;) at least for Maven 3.0!

Nexus presentation: interesting point: compatible with P2 and OBR
http://repository.apache.org
http://repository.sonatype.org
http://oss.sonatype.org
http://osgi.sonatype.org

Hudson


Drools workflow to build release processes
Integrating JSecurity (Apache Shiro)
REST layer
Maven 3.0 like plugins
Eclipse incremental compiler


Gosh this presentation is full of good news! Hopefully the result will be as good as promised...

Jazoon Day 1: Glassfish v3

RRails native deployment
Modular because of the requirements of Java EE 6 Profiles

Modularity


Based on OSGi (Apache Felix by default)
190 bundles (too many probably, but necessary at first, will decrease through time...or so they say ;))
Modules have responsabilities (provide services) and a lifecycle
Maven was used for the build

Developer features


Integration with IDEs
Fast startup, restart in debug
Exploded directory deployment
therefore... Fast deploy on save
Preserve session across redeployment
Application runner: java -jar glassfish.jar myWebApplication
> Maven/ANT integration
> Award winning UI console

Java EE 6 EJB 3.1 in web apps is really a very nice feature. It also seems that @Resource can now inject elements that come from other sources than JNDI! NICE!!

Runtime


Kernel
startup/shutdown
deployment
configure reading
Services
Java EE 6: Security, Naming Manager
Products; Admin consoles
Containers
Java EE 6: Web Container, EJB Container...
Other possible custom containers (RRails)

Application container


Deployment
Configuration
Commands (CLI, REST operation)

Service Based Architecture


HK2 Services: Abstraction to OSGi services
Per thread / Per scope scopes
Integrated lightweight dependency injection
Based on annotations (Container, Service, Inject...)

OSGi services can be injected with @Resource Java EE annotation.

Jazoon Day 1: Spring 3.0

Java 5+ foundation


even more support for annotated components
BeanFactory returns typed Beans
T getBean(String name, Class<T> requiredType)
TaskExecutor extends java.util.concurrentExecutor
extended AsyncTaskExecutor supports Callables and Futures
Typed ApplicationListener
ApplicationEventMulticaster detects declared event type and filters accordingly.
Annotated Factory Methods
Use of Meta-Annotations
This is indeed really great! It allows to potentially have only annotations from your own packages in your code.


Portfolio rearrangements


Spring OXM now in the core
Revised binding and type conversion infrastructure: Superseeding standard JDK PropertyEditors


Spring Expression Language Unified


a kind of unified EL++
EL default attributes: systemProperties, systemEnvironment, and any spring bean through its name(s)
Contextual attributes depending on scope (access to request/session attributes for example).

REST Support


Client and server side
Defining URIs
JAX-RS

Declarative model validation


Hibernate Validator, JSR 303
Annotating fields with constraint annotations

Support for Portlet 2.0


action/render/event/resource request mappings

Early support for Java EE 6


JSF 2.0
JPA 2.0
JSR 303

New Namespaces


Scheduling namespace
@Async annotation for methods
@Scheduled for cron-triggered methods
Namespace allows scanning of these annotations, and declarative equivalent Expressions
Custom CRON support

Pruning


Commons Attributes support
TopLink API
Subclass-style Struts 1.X

Deprecations


traditional MVC form controller hierarchy: no new features
traditional JUnit 3.8 test class hierarchy => now Test Context framework

Jazoon Day 1: Concurrency and Performance reloaded

Already lots of issues in single-threaded applications.
Moore's law is continued by multiple cores.
Concurrent programming is not possible yet, we can only cope with it.

Sadly (or not) concurrency is the main programming focus nowadays.

We have to deal with concurrency explicitely while before you could just wait for the platforms to improve and gain performances ;)

Problems:
- Hardware components are not shareable.
- Access to shared data has to be serialized.
- Databases offer access to shared data.
- Serialization limits scalability.

He then talks about Amdahl's law (parallel computing is limited by the time needed for the sequential part of the computing)
and Little's law (Throughput is inversely proportional to service time).

In Java: locking is pessimistic. Huge problem.

In fact 99% of locks are almost never really contended, and a large part of those will never be contended at all by design.

In Java 1.5, we have Java Locks and system level locks (hotspot profiles the application and determines if a lock is contended or not, and choose one or the other)

Lock coarsening uses one lock only for nearby equivalently locked operations.

Compare And Swap (CAS) used in Atomic classes. Fails only if another threads updates the data during your access. Needs less locking.

Biased Locking:
If a thread continuously acquires a lock, CAS is not used, and the thread keeps the lock until another one is reclaiming it (unbiasing)

How to code this correctly:

java.util.concurrent of course (Atomic*)
Lock striping (ConcurrentHashMap)
Teaching threads to steal (after all Garbage collecting is doing it).

In 1.7: Fork-Join

Fully concurrent lock-free algorithms:
No blocking, threads are never waiting for anything.
Wait free is different of course but should be achieve
Parallel reads, serialized writes

NonBlockingHashMap scales very well up to 1000 CPUs even for R/W, when ConcurrentHashMap doesn't.


Fully concurrent lock-less FIFO?
What does FIFO mean in multicore?
=> Doug Lea's wait-free queue (getAndSet(V))

Things that don't make sense
Iterator
Size
Contains

These are not relevant in highly concurrent environment.
APIs must therefore be re-thought through.

Very nice yet intricate talk. Too bad there's not more time for Dirk Pepperdine to go more into details!

Jazoon Day 1: Keynote by James Gosling

Starting with the JavaOne video
J.Gosling is then talking about network orientation, and the fact that Java is more about the JVM(s) than the language.

He then demonstrates Glassfish v3 (finally, EJBs in webapps...) and Netbeans v6.7 which looks honestly pretty slick...

Then talks about Real time JVM, and Intelligent Meshes (Sunspot (Squawk) VM, Sentilla.com).

Talking about Hybrid car of Neil Young ;). May I suggest the guy is a little cocky there? ;);)

Performance in java
Actually better than C/C++ in most cases.
He then demonstrates the now common assertion that Moore's law is now wrong if you don't consider the number of cores (not if one takes them into account).

Funny point on the fact that most of what is happening on scientific calculation is driven by the progress of video games.

A bit of advertizing on JDK 7 talk the following day.

Java 6 updates (from 10 on)
Fixes Desktop integration
G1(Garbage first) collector
Compressed pointers 32G==4G

Web as the face of the Enterprise
=> JavaFX: same result as Flash, yet easier... still not convinced by that... :p

mardi, juin 23, 2009

OSGi DevCon Europe: Emulation of Devices with Flash and OSGi

Interesting presentation on the emulation of devices.
The word "Device", in the embedded "world", is used to describe technical component which does only one kind of thing with a clear contract (display, sound, gesture capture...etc).
Therefore, an iPhone is an assembly of devices.
The iPhone development scheme is sadly inefficient in terms of testing.

In order to test devices properly, they are advising to build an OSGi bundle for each device, and a flash interface for the device with xml-sockets (or any other equivalent client technology).

Note that the client part is not mandatory, but allows product owners to define additional features and even capture test scenarios.

Sadly, they are not open-sourcing (yet?) the framework they built for that.

Wow... this was a fully packed day...

OSGi DevCon Europe: RFID and OSGi devices

Collecting real data and analyse it in the I.T.System.

Learned about MOSGI (JMX for OSGi) RFC 139

Learned about ALE reports which are events published by RFID Readers.

Starting to be a bit tired... too many presentations in one day :p

OSGi DevCon Europe: Transactions with OSGi

Presentation is very good. Clement Escoffier is very dynamic, and has good vocabulary, and a very pronounced frenchy accent and grammar ;) (who am I to say?)
Very good explanation of the basics of transaction. Should be learned in schools as is ;)

Indeed transactions are hard to handle in a system where the transaction manager bundle or the transaction participants can leave during a transaction!

iPOJO Transaction Handler does that (amongst others). I'm still not clear if this is part of 4.2 release of OSGi.

OSGi DevCon Europe: OSGi + Spring Integration

A little definition of "Performance"


Response time (classic)
Throughput (concurrent processing)
Utilization (Map-Reduce)

Scalability & Reliability (you have to choose a good balance between both)

Code supernova


Nothing is perfect
Code bases shall grow
Teams grow, you get more people and therefore more bad developers
More bugs.... ad lib...

I really like this concept ;). It fits so many projects have seen which are more patchworks than real products!

Single Thread Breakdown


One thread => single core
You can deal with more requests, but hardly improve a lot the treatment of one.

Synchronous breakdown


doing something, call another component , wait, finish.

Spring Integration is about EIP



Allows decoupling, if you add this to OSGi it's a nice combination.

Very nice and professional demo, done with very nice Spring STS ;)

OSGi DevCon Europe: Nimble

YA Dependency resolver/Provisionning tool ;)
Looks interesting.

Once again, Artifacts, Capabilities and Requirements (see p2)
The structure there is a "Part" (see p2 IU in a sense)
a "Rule" is a template for a "Part"
It also defines a concept of Extensions.

Gosh... such a short presentation on this results in a mess...

Demo
A lot better with a demo...

Nimble allows you to enforce Policies on provisionning. NICE!!!

http://nimble.codecauldron.org/

OSGi DevCon Europe: p2

p2, modular provisioning for OSGi

One consistent model from installation to servicing.

Concepts:


Everything is an Installable Unit (IU)
IU can have:
Actions (steps to perform to fully deploy)
Artifact reference (allows to reference dependencies without pointing directly to its location)
Capabilities and Requirements
Artifacts are:
Bytes/content to be installed (JARs, binary executable, RPM, MSI... etc)

God these presentations are too short.. The guy is talking too fast.
In the end, I already thought p2 was a bit of a mess, and as much as I want to like it, I'm still not clearly convinced by it.

OSGi DevCon Europe: Blueprint services

DI, yet Legacy code-compatible, OSGi Dynamics, Hide OSGi API

Configuration:

Uses the extender pattern: The Blueprint Extender scans bundles to find xml files, creates metadata from them, and then creates beans, services, references.

Manager Types:

Bean Manager: creates POJOs and possibly wire dependencies.
Single Service Reference Manager: one to one mapping with OSGi service
Multiple Services Reference Manager: one to many mapping with OSGi service
Service Registration Manager: Allows to register a POJO as an OSGi service

Bean Manager

takes as input a configuration which is very close from the Spring bean configuration.
No, in fact it is Spring configuration reloaded... ;)

To summarize: BluePrint is a standardization of Spring DM and of Spring DI configuration.
BluePrint already has other implementations (amongst them Geronimo Blueprint by G.Nodet who gave this talk)

OSGi DevCon Europe: POSH

POSH: Paremus OSGi Shell

RFC 0132

The man is yelling! ;) (Microphone too close to his mouth)

Yet the topic is interesting, it's about standardizing OSGi commands between frameworks.
For example "ss" in equinox is "ps" in Felix...
Not open source... even if pieces of it are part of Newton :p

OSGi DevCon Europe: Pax

Tools and service implementations (framework independent)
Widely used (Apache Felix, Mule... etc)

PaxConstruct

A bit like maven archetypes (on steroids) for OSGi.
pax-create-project -g foo -a bar
pax-wrap-jar
...etc

PaxRunner

Standard launcher for major frameworks (Apache Felix, Knoplerfish, Equinox, Concierge...)
Does the provisionning of required artifacts
Generates Configuration files
Generates packages for a target platform

PaxExam

Allows testing of OSGi services. NICE!
Compatible with JUnit 4 and Maven for setup.

OSGi DevCon Europe: Remote Services, Yet Another one ;)

Remote Services demo

service.exported.* properties for registered services
NICE!!! OSGi service exposed with CXF
NICE' !!! Discovery mechanism is in the works for the client side

Presentation of an Asynchronous remoting example/experiment.
This is not really available right now... and seems to be an example implementation.
Yet interesting ;) implemented by an OSGi Event dispatcher that allows to decouple from the implementation.
Drawbacks: No guaranteed delivery, No error handling with existing API. At least not yet, but this is experimental.

Demo of ActiveMQWrapper behind the EDS (EventAdmin is the point of contact)

http://cxf.apache.org/distributed-osgi.html (RI of OSGi 4.2 Remote Services)
http://lightsabre.fusesource.org (OSGi Asynchronous Messaging, experimental)

OSGi DevCon Europe: Persistence

OSGi Persistence


Java Persistence standards

JPA
OXM: JAXB 2.X
EDIT (see comments)
OXM: SDO 2.1.1 JSR 235

Eclipse Link

JPA, MOXy (Object-XML), EIS, SDO, DBWS (XML-relational...Oracle :p)
Currently JPA 1.0 compatible, and working on 2.0

MOXy

Complete Object-XML mapping
Provides external mapping file! NICE!!! Never understood why they didn't give that option in JAXB...

EclipseLink available as OSGi bundles

Supports usage of standard APIs (Persistence.createEntity, JAXBContext.newInstance(), commonj.sdo.HelperProvider)
Supports modular packaging
Decouples application from provider (Through JPA tag)

Challenges for OSGi and JPA

Bootstrap in JPA scans the classpath
Provider needs access to domain model classes
Needs access to JDBC driver (addressed RFC 122)

Challenges for OSGi and JAXB

Spec SPI does not support registration of providers
Provider needs access to domain model classes
Though supports passing domain model classloader

Challenges for OSGi and SDO

Spec hardwires everything so it doesn't support custom providers

JPA 2.0 will include dynamic resolution.

OSGi DevCon Europe: Remote Services

Module management in java

Mystical class path
In the end, classpath is flat
With OSGi: explicit dependencies, yet declarative
Allows events, dynamic handling, introspection
Services in OSGi allow to reduce coupling, but when package dependencies are explicit it limits the modularity.

Service Registry

Registering services by name, therefore allowing to reference a service without dependency on the implementation

Distributed OSGi

Remote can be separate machine, or separate JVM
Why? Isolation, Redundancy, Distribution is needed by your architecture

OSGi 4.2 Remote Services

Service Hooks (can intercept service requests)
Proxies
Intents (denotes an abstract distribution capability, requires mutual agreement, derives from SCA)

Very Nice: R-OSGi Deployment definition tool for Eclipse!

Remote Services Mostly based on the fact that services are stateless.

Work in progress: replication,Research prototype: Cirrostratus


Interesting as this allows completely virtual deployment of bundles.

Though it is unclear how much of what is presented is actually really available. Presentation is tough to follow, yet very interesting.

To summarize, seems that for stateless services, OSGi 4.2 would be enough, Cirrostratus prototype deals with state replication, service migration and hardening policies.

lundi, juin 22, 2009

OSGi DevCon Europe: Keynote

Keynote

Detailed description on what's going to be available in next releases (Core, Compendium and Enterprise).

Launching:

Need for a standardized launching system
Allows to embed easily the framework in your application
Using the service system of Java 5 (META-INF/services)

Service Hooks

Allows to listen service access events, therefore allowing interception for example.
FindHook, EventHook and ListenerHook.

Negative Permissions

Java 2 permissions: Very heavy to enumerate explicitely what is authorized and skip what is not.
Adding DENY and ALLOW. This is very nice! If it could just be implemented this way in Java 2 permissions...

Remote Services

RFC 119 (Formerly Distributed OSGi)
Remote access to OSGi services, protocol-independent.

Blueprint extender

RFC124
Provides Spring DM-like Functionality
Provides Service damping (wait until service is available) which is a very nice feature!
Defined through XML, a Blueprint container retrieves Metadata for Beans, Services, and References, and then creates corresponding elements from these metadatas.


Enterprise release

Transactions, JDBC, JMX, JNDI, JPA, Connectors

Experimental

TSL Tiny script language
Uses reflection but simplifies syntax (no new commands)
Sounds fun!

Nested frameworks

Application servers need an application model
in OSGi: Application==set of installed bundles
Compromise: frameworks should be nested

Java Modularity

module keyword would be nice for OSGi
The rest is over simplistic and will probably introduce more issues than it will solve... and BTW, it will only be available in Java 7 (why a language feature for that????)

BTW First time I hear a dog barking in a conference ;);)

Conferences in Zurich, day 1 : OSGi DevCon Europe

Starting my blog marathon, especially for you, my reader ;).

Today is the day before bootstrap of Jazoon.
Today is community day and offers 2 conferences: One about Glassfish, and another about OSGi.

I must say I would have loved to attend both, but, as always in this kind of conference, you have to make tough choices.

Well... not so tough, as OSGi DevCon talks have a lot of diversity whereas Glassfish talks are a lot about Glassfish...
Let's say I used diversity as a filter and leave it at that.
I'll definitely try to attend some Glassfish 3.0 talk during Jazoon anyway.

So stay tuned for regular updates my dear reader, and have a nice monday!

mercredi, mai 27, 2009

My wishes for a better Maven 2

My main concern with maven builds is their lack of stability. Mostly in terms of dependencies.

This is why I think that the following simple (apparently as I guess implementing them, though it seems simple to me, would possibly imply errors in exotic plugins) wishes would save the day of a whole lot of people (including of course... me ;) ).

First things first: Exclusions.


In a perfect world, everybody would declare dependencies properly (with a proper scope defined for
each, and optional dependencies declared... optional...) and versions resolutions for conflicting dependencies would work exactly as expected.
If you have used any of the repositories out there (even official ones) you know that some weird dependencies can irrupt in your project's Manifest.mf file, WEB-INF/lib folder, or any other proper place to put transitive or direct dependencies of your artifact.
Moreover, if you are building complex multi-modules project, you'll know that versions are not always resolved as they should.

Right now, the only option is to exclude artifacts one by one. What a pain in the arse!
Please please please, add wildcard exclusion!!!, or even better, a <transitive>true|false</transitive> element to the <dependency/> element.

One step further: I don't care about transitive

In some cases, you'd want to experiment, or are quite sure about the dependencies you want, but for a precise reason, don't want to retrieve any of the transitive dependencies.

It would be really nice to add a <transitive>true|false</transitive> element to the <dependencies/> element of the pom.

You would then be able to declare all the dependencies of your project without relying on transitive mechanisms.

This would really be an asset when you are handing over your build to maintenance, or building a stable release.

Even better: How about making this automatic

How nice would it be in this case that when the project is in the early dynamic phases, you specify your basic dependencies and retrieve the rest transitively, and...
...then...
At some point where you want to stabilize things or be sure of the outcome, you just launch for example: mvn dependency:flatten and "Voilà!" your pom.xml now contains all your project's transitive dependencies, with appropriate scopes computed, and the aforementioned <transitive>false</transitive> element added to the <dependencies/> element.

I for myself would find this very intuitive and simple to use, without interfering with the current behaviour of maven at first glance (backward compatibility my friend!).

For something completely different: splitting the local repository


This last wish is likely to remain a wish as I think it would require too much work.
But it's a sad thing that the local repository is not split between a plugins repository and a artifacts repository in some way.
The plugins repository would contain plugins and all their dependencies, and the artifacts repository would contain other artifacts and their dependencies.
This would disallow the intrusion of plugins' dependencies in your build.

Though this wish would not be a real issue anymore if the previous wishes could be granted.

To sum it up: Dynamics and Automation, plus Control!


Maven 2 is a great tool and offers a very good way to have build with dynamically changing dependencies. When set up, you don't always have to go and look for the latest build of your dependencies, and can automatically retrieve them.

Though sometimes, a bit more control is needed, and it would be very nice to have this kind of choice.

EDIT: After wishing I did my homework and went voting for http://jira.codehaus.org/browse/MNG-1977 Go there and vote for it!!!

lundi, mars 02, 2009

Dwell in hell JaxB!

Feel free to join the JaxB bashing... ;)

As pointed by David Josh is not really happy about JaxB's behaviour.

It is even worse than Josh thinks or experienced, as the specification is based on the fact that your objects are plain Java Beans (with all the quirks of this damn spec...).

I had an equivalent unpleasant surprise while giving a training on JaxWS (which specifies the use of JaxB recently) last december.

The week before this training, I had worked on a domain-driven persistence design, with immutable objects, write-only repositories and read-only fast-lanes (will soon blog about it hopefully if it's interesting enough)...
With this purist state of mind, I started creating in front of all the "students" a beautiful domain with Immutables (BTW I should have stuck with the default examples, though I wanted to demonstrate how easy it is to use JaxWS starting from scratch).
Yet be warned, an Immutable cannot be a JavaBean, as these beasts can only be created with the default no-args Constructor and their state modified by their getters/setters....

Isn't that the stupidest thing in the world????

What would be a best candidate for disconnected transfer (HTTP usually with WS) than an immutable object?

I know for a fact that an External view of the service should separate my domain from the view I give from it to the outside, yet even if good APIs exist for the copy of the states of beans, it's still a shame to be forced into java beans which are only useful for damn Swing developments (BTW I think I could wish hell to swing for being part of the JDK and being the motivation for the addition of a default implementation of database and web services inside the JDK/JRE.... what a nonsense).

So in the end I completely agree with Josh and am still looking for a better ways to use immutables in J(2)EE applications. It seems that the whole platform was build without these beasts in mind.