« Return to Thread: JavaRpc code modularity

Re: JavaRpc code modularity

by Michael Wyraz :: Rate this Message:

Reply to Author | View in Thread

Hi Andreas,

- TODO: Use commons-logging
    

Not so good (IMHO). If at all possible, the "RPC core" should not  
depend on a specific logging framework (or "meta-framework" in case of  
commons-logging). It's always a pain to deal with different logging  
frameworks, even if it just means configuring commons-logging to use  
java.util.logging (assuming you're using j.u.l in your application  
code). Maybe logging can be delegated to sub-classes? This way, you  
could avoid having c-l in your runtime classpath if you don't need it.  
This is no showstopper though - a refactoring that depends on c-l is  
better than no refactoring at all :-)
  
Ok, I'll re-think this ;-) But atm there's dependency to commons-beanutils and commons-collections. So i thought, commons-logging should also be ok. All other approaches would only introduce another (minimal) logger wrapper.

- DONE: added support for enums
 - serialization: js object attributes "name"=enum.name(),
"ordinal"=enum.oridinal(), "string",enum.toString()
 - deserialization: Integer -> ordinal, other -> name
    

I'm not so sure about this. enum support is very welcome, but it  
should be possible to do roundtrips (Java => JS => Java). It doesn't  
sound like that's the case with your approach, and it's a bit  
unnatural to deal with an enum value this way in JS. My suggestion  
would be to simply output enum.name() as a string for serialization.
  
This has pros and cons:
pro: much more simple roundtrips (enum -> string -> enum)
con: loss of information (e.g. i use the "toString()" of an enum to create a readable label for it)

Another solution would be to also accept the { name: ..., ordinal: ..., string:... } object on deserialization (or more generall any object that has an integer property "ordinal" or a string property "name".

Regards,
Michael.



------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

 « Return to Thread: JavaRpc code modularity