jSeamless - Number Guess

This is very much off-topic as it has nothing to do with game development, but it’s a project I’m working on and something that I think others might be interested in.



Besides, it’s really awesome and I wanted to share. :wink:



http://forum.captiveimagination.com/index.php/topic,223.0.html



Or if you don’t want to follow one post to another post just to get to the good stuff:



http://pyramex.com/jseamless_tests/

hmm, your link seems to be broken, im getting http status 404

I took it offline temporarily because there was a memory leak and I was getting WAY too many hits.  After 5,000 hits it pegged Tomcat and threw an OutOfMemoryError at 3gig. :o



I've got the problem fixed but now I'm doing some local stress testing on it to make sure there isn't anything else that will come up that's going to bring my server to its knees.  :P  I'll post another message when it's back online.

Okay, it's back online after some fixes to memory management.  Apparently with 5,000 connections storing large objects in the session isn't a good idea. :wink:



I've created a complex disk caching system now that will manage sessions exceeding the memory cache limitation so the oldest will be persisted out to disk until it is needed again.



Let me know if you have any problems running it now.  It does require Flash 9 and I haven't gotten the HTML page correctly handling older versions to make you upgrade yet, so currently it will probably just not render if you don't have the right version.

i can only confirm that it doesn't render with flash 8  :frowning:

I can confirm that it's working on FF 2 with Flash 9.

I'm afraid I forgot what jSeamless was about. A technology for rendering Swing/JFC using different Web technologies (Flex, OpenLaszlo, HTML w/ Ajax)?

Well, sort of.  It's very similar to Swing in appearance but the API is not actually using Swing.  jSeamless is meant to be a UI abstraction so you don't have to consider about what technology or even have a deployment plan (web, installed application, etc.) for the development, that can always be decided later and even changed after that.  You simply develop your UI with jSeamless and then use one of the implementations to "render" it.



This preview is actually rendering to Flash using Adobe Flex SDK (with an awful lot of custom code behind the scenes).

So basically you're going in the complete opposite direction of where everyone is heading to (XUL, XAML, Flex, OpenLaszlo, ) by making the programmer create the interface in code instead of defining it using a DSL/ML in an external file. On top of that he (the programmer) has to learn another API to accomplish this, which is understandable due to the differences in between the render technologies and thus the provided functionality but is nevertheless a burden.

Don't misunderstand me though. You seem extremely capable and I'm sure I wouldn't have neither the skill nor the energy to pursue so many different and great projects but I'm trying to understand whom you're targeting with this project.

Sort of…it definitely is a different direction. No XML, CSS, HTML, JavaScript, etc. - just Java coding.



You don't have to learn anything but a very simple Java API to use it.  The implementations for jSeamless are provided and are pluggable, so you the developer using jSeamless just has to download whatever implementation(s) you want and use it.



For example, an extremely basic application in jSeamless:


Application application = new Application("My Application");
Button button = new Button("My Button");
application.add(button);



That's it....from there you just reference that properly in the implementation and you're done and you have a renderable application.

For a little more complicated example refer to the forum entry URL I posted at the top to see the actual source code for the NumberGuess.  As the developer that's all you have to write.  You don't have to know HTML, CSS, Flash, JavaScript, XML, etc....you just use a simple Java API and leave the rest of jSeamless.  You don't even have to consider Client/Server because jSeamless hides that from you.  As far as you're concerned you ARE the client at all times.  In the web application scenario it uses Ajax to handle that and everything is invoked on the server but streamed immediately to the client for immediate response times.

Make a little more sense?

You think you didn't quite get the aspect I was criticizing because I due understand that jSeamless automagically creates the glue between the GUI definition and manipulation code and several different representations using various techniques on possibly different machines. That's the point that I understand and which I do find interesting about it.



OpenLaszlo does this as well (kinda) since it can render in Flash 7/8 as well as as 9 and nowadays HTML/CSS/JS too. Like Flex it provides a common syntax for defining and writing applications using XML and JavaScript.



The fact which I don't get is why you have created another proprietary API because it will evolve into something more complicated like Swing, or SWT/JFace. You can't create a simpler API than those already available because you're attacking the problem (creating a GUI) at the same level. To be honest you're probably making it even harder because you don't provide (yet) a view of decoupling the data model and the representation and manipulation using graphical widgets. Instead of using the various techniques provided by Swing and JFace like viewer and databinding frameworks, or the helpers in Flex and OpenLaszlo the programmer will have to write the glue code by himself. Already available WYSIWYG GUI designers for Swing and SWT (Matisse, VE) as well as other helpful add-ons or frameworks and tools cannot be used. All these are reasons why someone would decide against using jSeamless for non trivial applications.

Well, I actually considered writing the web implementation of jSeamless with OpenLaszlo and spent quite a bit of time working with it.  However, in the end I decided against it because the syntax was so poor and there were so many bugs in it.  I like Flex a lot more but both of these are quite unusable by themselves I think since you end up writing your application in XML instead of a structured language (like jSeamless or Swing).  Yes, it is pushing things back in that you won't be able to use any of the pre-defined WYSIWYG editors, but those will come eventually for jSeamless if it is successful.  Further, it goes for a similar concept as OpenLaszlo to write the code once in use it in multiple different arenas (Flash or DHTML for Laszlo), but doesn't limit you to just the web.  You will be able to write applications in jSeamless that will render to Swing (and eventually maybe even FengGUI).



In a Java API like jSeamless or Swing you can encapsulate your components for re-use and simplify your code into a more modular design, but that is quite a bit more complicated in XML.  As for data binding I actually already have some support for that in jSeamless, but that's a higher level system that wraps jSeamless.



The preliminary goal of jSeamless was to make web development easier and more powerful in Java.  The second goal was to make jSeamless abstract so that it can be used for web or application development without any changes to the code.  Both of these things I believe set it apart from systems like OpenLaszlo, JSF, etc.



There are other systems out there that go for similar goals (but I believe I am the first to do an entirely abstract UI system) like Echo2, but in the end the implementations had significant flaws in my opinion.

Yeah, the bugs in OpenLaszlo and the fact that it felt very unfinished scared me off too. It is definitely powerful but creating UI which were just a tiny bit more complicated than those in the examples ended in huge, complicated, spaghetti code like XML files. Most of it is probably because I was a newb at using it but nevertheless it did reinforce my opinion that XML is not a terribly great idea for this domain. OpenLaszlo however did have some nice ideas, brining in OOP to it's XML UI ML was neat.



To be honest, I'm not even a great fan of the RIA craze these days. What advantages do they have in comparison to a WebStartable Eclipse RCP product?



Anyway, thanks for taking some time to explain your motives for creating jSeamless and your ideas on how it is going to evolve. I wish you and your numerous projects the best.

No problem…I always have good reasons for creating "yet another" project instead of re-using something that already exists.



Granted sometimes that's just to learn from, but rarely do I ever make those projects public. :o (I wrote a database a while back but couldn't get it to work as fast as MySQL so I got mad and gave up on it)