ripple-unmaintained / ripple-lib-java

Java version of ripple-lib (work in progress)
ISC License
126 stars 109 forks source link

Usage in JavaEE 7 application #4

Open ebirn opened 10 years ago

ebirn commented 10 years ago

My primary use case for this ripple library is JavaEE server-side applications.

While this appears to be possible from the current state, some library changes could strongly improve its usability there, without impacting the use on other platforms such as Android.

2 things caught my eye: In both cases there exist javax.* apis, that could be used here, giving the advantage of the ability to use interchangeable implementations

I consider the switching of the websocket implementation most important, as this is the only way to make use of application server resource pools (i.e. connection pooling, etc.). As far as the JSON implementation goes: when switching the websocket api one could also consider to move the json (de)serialization to a JAXB based one.

sublimator commented 10 years ago

I'm not really a Java specialist, can you explain what JAXB is?

ebirn commented 10 years ago

JAXB basically allows you to serialize/deserialize java objects directly to JSON or XML, using annotations on the classes and therefore reduces the boilerplate json creation code.

see here for an example: http://www.mkyong.com/java/jaxb-hello-world-example/

sublimator commented 10 years ago

Oh, that looks really neat :)

Does it use code generation or reflection?

ebirn commented 10 years ago

the latter, looking at the annotations at runtime, no code is generated.