0 Replies Latest reply on Jul 8, 2008 12:24 PM by ann.r1

    [Ann] R1-RPC/J Toolkit for Java-Flex/Flash RPC

      R1-RPC/J is a toolkit for Java-Flex/Flash RPC bridging. The RPC is simple and intuitive, light-weight, and robust. As an RPC solution, it has everything you really need and not more than what you must have. With R1-RPC/J, you maintain the greatest liberty in your system design choices. Another invaluable feature of the toolkit is the automated RPC unit tester generation. The tester makes RPC calls exactly the same way as your application (under development); this is not only useful for debugging multi-tiered systems, but also facilatates better teamwork between different teams.

      Using code generation technique, you can painlessly do strongly-typed RPCs from Flex/Flash clients to server-side Java. This solution simplifies (but does not reduce) the server-side Java to Facade and Value Object (VO) classes. Such Java classes are created by the Java programmers, and counterpart AS3 classes are generated for the client. The client code simply calls/uses these AS3 classes natively; the only trace that betrays the RPC nature is the mandatory callback. In VO Java classes, you can embed AS3 code to be generated (copied) in the generated AS3 classes. VO classes can extend each other, and inner classes are supported as well. Server exceptions and systems faults are handlable in client code.

      R1-RPC/J supports CHAP login and plain-text password login. Facade methods can be specified as authorized or not. Server session timeout can be mitigated from the client side.

      On the server-side, remote calls can be intercepted at different phases, so you can choose to track or even alter them. This can be useful for your system design, and can be extremely convenient for debugging.

      The automated RPC testing works this way: for a facade method to be tested, in its javadoc comment, you specify its unit testing input and result checking code. Test cases are generated, and are linked with a Unit Tester GUI (source available) to generate a Flex testing program. The Unit Test API is also available and well documented, so that you can create custom unit testing for any purposes (not limited but probably related to RPC).

      These features are available in v1.1. There are more exciting features in the plan.

      The diagram in the White Paper tells all. To learn more, visit http://www.riaone.com/products/r1rpc/ . (It is listed on Flex Exchange as well.)

      Attached is a simple Java facade class and its generated AS3 counterpart.