Rapid development and deployment of java web clients

Discussions

News: Rapid development and deployment of java web clients

  1. Years ago I used to write protocols for client <-> server communication - packaging strings, integers and other objects in my own byte representation. Then I discovered the power of serialization, and found that I could just send complex objects directly using an objectstream. Pretty cool - cause I didn't have to spend time creating protocols anymore. This lead me to find a way to use serialization to do method calls directly into the server api - and I found that by sending information about object, method names and parameters I could use reflection on the server to invoke the requested method, and serialize the result back to the client. The real convenience was when I discovered what dynamic proxies could do for me - and I found that I could use the same interfaces on the client as on the server. Calling server apis from the client became just as easy as it is on the server - and I can develop my clients more rapidly than ever before. Typically the clients I am talking about is primarily Java applets, but also other clients. For Java applets though, where the classes are loaded over http, just as any web page, I thought - why couldn't just a servlet find the class binaries from the already compiled server classes? Earlier I used to have a packaging script to prepare the applet classes, but if they were part of my server code, I should just be able to use these, without having to prepare a separate package, right? This lead to a servlet being able to push server class binaries to the browsers URL class loader - and it became even more convenient - cause I didn't have to package my applet classes anymore. I also wrote a custom launcher so that I could debug the applet with parameters and custom codebases - the AppletViewer that comes with the jdk has limitations there. Finally my colleague saw that it would be an advantage to be able to package the applets in JARs (for faster loading) and also be able to sign them to walk out of the applet security sandbox. He wrote code that would automatically figure out the needed classes for a JAR, and also able to package and sign the JAR on the fly (on demand). This means - no extra clicks and deployment preparation regarding packaging and signing of applets - a complete system for automating the processes of creating client-server communication interfaces, class deployment, class packaging and signing. A truly significant gain regarding reducing development time. The result is LMAppletserver (http://lmappletserver.sourceforge.net) - please check it out - try writing java applets in a new way - a convenient way. You will be amazed by this approach of writing rich and functional clients for the web.

    Threaded Messages (16)

  2. Though I'm sure your software is high quality, doesn't Java WebStart solve alot of these problems as well? Do you have any comparisons? Kit
  3. Though I'm sure your software is high quality, doesn't Java WebStart solve alot of these problems as well?

    Do you have any comparisons?

    Kit
    Peter has started developing his software years before JaveWebStart became usable as it is now. And I am sure that HIS software does better job for HIS problem in HIS environment with requiremets HE has then JavaWebStart! Off topic: People in Java community are nowdays opsessed with XXX frameworks and YYY libraries. This obsession has gone too far. Although often is more pragmatic to choose well known, well desgined, well coded, well documented and well supported third party framework or library (and these are still rather rare), sometimes is also more pragmatic to use what you already have developed in-house or even build it yourself.
  4. my challenges and frameworks[ Go to top ]

    Though I'm sure your software is high quality, doesn't Java WebStart solve alot of these problems as well?

    Do you have any comparisons?

    Kit


    Peter has started developing his software years before JaveWebStart became usable as it is now. And I am sure that HIS software does better job for HIS problem in HIS environment with requiremets HE has then JavaWebStart!

    Off topic: People in Java community are nowdays opsessed with XXX frameworks and YYY libraries. This obsession has gone too far. Although often is more pragmatic to choose well known, well desgined, well coded, well documented and well supported third party framework or library (and these are still rather rare), sometimes is also more pragmatic to use what you already have developed in-house or even build it yourself.
    Though we made this to solve our own challenges, I really hope there are more people that have similar thoughts on simplifying applet development and packaging. I believe that the purpose of frameworks, is to give good practices legs to stand on. And in some cases they also turn into best practices. It's good to have these practices buildt into my software development platform, and not only in e.g. a book. For the web - there are a lot of good frameworks, buildt upon good practices. For example the Google web toolkit really makes developing AJAX functionality a dream - Java all the way - even though there is lot's of javascript - but you don't care about that. However, for applets I haven't seen any approach like this on simplifying communication and packaging. Hence the appletserver. And you may ask why I couldn't use gwt and Ajax? Well, the reason is that Ajax is still javascript, and though it might seem like Java all the way, it's really not. What if you e.g. want to pass complex entity bean structures onto the client without having to create a special client representation? Java on both sides makes it possible. It seems to me like people have given up on applets now that AJAX move forwards. But remember that AJAX is not java. We have java in the mobile phone, mobile terminals and everywhere else. Why should we now abandon it in our web pages? Javascript will never be able to deliver this kind of performance, nor developer flexibility. cheers, Peter
  5. Use Echo2[ Go to top ]

    And you may ask why I couldn't use gwt and Ajax? Well, the reason is that Ajax is still javascript, and though it might seem like Java all the way, it's really not. What if you e.g. want to pass complex entity bean structures onto the client without having to create a special client representation? Java on both sides makes it possible.
    Use Echo2. All Java. Feels like developing a Swing app. http://www.nextapp.com/platform/echo2/echo/
  6. integrate with spring[ Go to top ]

    I have use the imappletserver in my project, i think it is very pretty for applet develop. But i think it can be my powerful, for example if i use @AppletServiceInterface annotation for serverice interface, i read the code of appletServiceServlet class, it use reflect to instance the object for the service object, it is ok to intergrate the service object retrieve from spring container, I think if it ok, it will be very powerful, and we can use the funtion of spring very easy . thanks
  7. Re: integrate with spring[ Go to top ]

    Hi, You can use the @AppletServiceInterface for any interface. By passing the implementing class parameter, you can instance whatever object you want. Not only EJBs. Does spring services require some specific instanciation? It would be no problem to modify the AppletServiceServlet class to instance spring services.. cheers, Peter
  8. integrate with spring[ Go to top ]

    Hi: I have used the @AppletServiceInterface for any interface. and passed the implementing class parameter. The problem is that, the AppletServiceServlet invoke 'class.newInstance()' method to instance the implementation class, so the object can not be manage by spring container. in spring all bean must by configure in xml file and instance by spring container. Only in this why, you can use the function, such as 'declaration transation'. so if you want to intergrate with spring, the code should retrieve the serviece interface's instance from the spring constainer, not create directly. Now, i use aspectj to implements this function. my aspect intercept all the newInstance method and return the object that retieve from the spring container. best regards david
  9. Re: integrate with spring[ Go to top ]

    A solution would probably be to let the @AppletServiceInterface be able to point to a custom instanciator. So that you could customize instancing code. Something like @AppletServiceInterface(targetClass=MyClass.class,createInstance=MyCreateInstance.class) Where MyCreateInstance class is implementing an interface that contains a createInstance method... That's my first suggestions - but probably there are better ways too. We can discuss further here: http://sourceforge.net/forum/forum.php?forum_id=478787 cheers, Peter
  10. Re: Use Echo2[ Go to top ]

    Is this any different than Google web toolkit? Other than using the swing api? it's still javascript on the client as I see it... cheers, Peter
  11. Re: Use Echo2[ Go to top ]

    Yes, there are differences. And similarities. http://blogs.pathf.com/agileajax/2006/07/echo2_vs_gwt.html
  12. Java webstart[ Go to top ]

    First java webstart doesn't run inside your webpage - which we wanted to in our case. Thus applets were the natural choice. Webstart legitimates the use of larger downloads (since it's more permanently installed), and thus you could have more sophisticated communication libraries - like e.g. web services. Applets though is reloaded every time you restart the browser, and then your libraries should be as small as possible. LMAppletserver adds less than 10kb to your applet size. And serialization and dynamic proxies are much much flexible than web-services if you're in a java-only environment. Java webstart still requires you to package your jars and generate your jnlp - though you can get nice tools for this. The cool thing with LMAppletServer is that deployment and packaging happens at run-time, and class-dependencies are resolved automatically. So you hardly have to spend time preparing packaging and deployment of the applet. Was this the kind of comparisons you were asking for? regards Peter
  13. Hi, I think Hessian provided by Resin solves this. And in the previous B/S applet projects I used that. So what do you think, Peter?
  14. Re: Hessian[ Go to top ]

    Hi, I've never heard of Hessian before now, so I took a quick look on their website. It seems like an excellent lightweight protocol that I'm sure also could be used in applet. What I didn't find out was about the protocol format. Since LMAppletserver uses serialization this opens to use almost any complex java type. However this limits to java clients only, which is not the case with Hessian as I see. So I wonder how much complexity can you have using the Hessian format? I didn't get this answer from the website (just did a quick look). The uses of Dynamic Proxy seemed almost the same. About deployment and packaging of Java applets, it doesn't seem to me that Hessian goes into this? It's primarily focused on being a lightweight webservice alternative, am I right? cheers, Peter
  15. Re: Hessian[ Go to top ]

    As part of a trail GUI-via-web project (with real use), I use Hessian as the protocol for my applet and also tried to do both a webstart and applet version, but spoofing the session ID (users only want to logon once) was very cumbersom and unstable. So the applet survived and webstart died. Hessian is ok, although I probably would go for Burlap now. The applet is up and running flawlessly for 2 years now and I'm very pleased with it. I think it is a great demo for further applet based applications. So I'm going to check out your library and see how it would fit in. Personally siging the applet jars at compile time, is not an issue.
  16. Re: Hessian[ Go to top ]

    Compile/run-time signing is convenient when you have many applets, and are working on the applet-code regularly. Then you want to save time figuring out the classes to include, as well as creating/managing packaging tasks. But for single applets you're right, it's not a big issue... cheers, Peter
  17. Real world echo2 example[ Go to top ]

    Heres a real world echo2 example http://www.jx2.com.au/vinx2.html There are some demo videos available - Cheers JA