[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Nemo 0.1.0 + Wee 0.4.0

Michael Neumann

1/13/2005 2:11:00 PM

Hi Rubyists,

We (Kevin and Michael) are proud to release the first public version of
Nemo and a new version of Wee simultaneously.

Nemo is a Ruby port of Mewa

http://www.adrian-lienhard.ch/file...

using Michael Neumann's Wee as the Seaside2 equivalent.

Nemo is a web-application platform that uses object metadata to
automatically construct web-interfaces (Editors and Viewers). It is
highly object-oriented with strong emphasis on reusable components.

What's Wee? Please read the URL below:

http://www.ntecs.de/viewcv...*checkout*/Wee/trunk/doc/rdoc/index.html

== Installation

gem install wee
gem install nemo

== Hello World in Wee

require 'rubygems'
require 'wee'
require 'wee/adaptors/webrick'
require 'wee/utils/helper'

class HelloWorld < Wee::Component
def initialize
super
add_decoration(Wee::PageDecoration.new("Hello World"))
end

def render
r.h1 "Hello World from Wee!"
end
end

Wee::WEBrickAdaptor.register(
'/app' => Wee::Helper.app_for(HelloWorld)).start

== Running Advanced Examples

Nemo example:

cd `gem environment gemdir`/gems/nemo-0.1.0/test
ruby -rubygems person_editor.rb
# Point your browser to http://localhost:2000/app

Wee example:

cd `gem environment gemdir`/gems/wee-0.4.0/examples
ruby -rubygems example.rb
# Point your browser to http://localhost:2000/app

== Project pages

http://rubyforge.org/pro...
http://rubyforge.org/pr...

== News in Wee 0.4.0

* Can be used with or without continuations
* renamed render_on to render.
* session now get removed when they are no longer alive.
* lots of other additions.

Regards,

Michael


17 Answers

Michael Neumann

1/13/2005 2:18:00 PM

0

Michael Neumann wrote:
> Hi Rubyists,
>
> We (Kevin and Michael) are proud to release the first public version of
> Nemo and a new version of Wee simultaneously.

Just to clarify: Kevin Howe wrote Nemo, not I ;-)

Regards,

Michael


Its Me

1/13/2005 3:37:00 PM

0

Wonderful!

"Michael Neumann" <mneumann@ntecs.de> wrote
> * Can be used with or without continuations

Are you recommending that continuations not be used? due to gc issues? other
reasons?

+1 for incorporating og


Its Me

1/13/2005 7:20:00 PM

0


"Michael Neumann" <mneumann@ntecs.de> wrote

> We (Kevin and Michael) are proud to release the first public version of
> Nemo and a new version of Wee simultaneously.

Just started looking at the demo ... very nice.

Do you have the XmlHttpRequest thing working? If so would it be possible for
Nemo to create smooth rich-client interfaces without page refreshes? e.g.
combine the view & edit pages into one:
- person edit-components <div>s are CSS-hidden until you click on Edit
- list Add component is a hidden <div> until click Add
- both the above are included (hidden) in the list view page
- Edit, Add just make visible the corresponding editable <divs>
- The Save/Cancel (and 'Delete') buttons do a XmlHttp request
- The response simply updates part of the DOM
- No page refreshes at all (in this interaction)

You could use Avi's Javascript to do the XmlHttp round-trip. It would take a
little additional Javascript, with a tweak to the css, to do the hide/show.

Or is there some underlying design of sessions, continuations, URLs, ids of
edited objects, the back button, etc. that would make this difficult?




Leslie Hensley

1/13/2005 9:59:00 PM

0

On Fri, 14 Jan 2005 04:21:14 +0900, itsme213 <itsme213@hotmail.com> wrote:
>
> "Michael Neumann" <mneumann@ntecs.de> wrote
>
> > We (Kevin and Michael) are proud to release the first public version of
> > Nemo and a new version of Wee simultaneously.
>
> Just started looking at the demo ... very nice.
>
> Do you have the XmlHttpRequest thing working? If so would it be possible for
> Nemo to create smooth rich-client interfaces without page refreshes? e.g.
> combine the view & edit pages into one:
> - person edit-components <div>s are CSS-hidden until you click on Edit
> - list Add component is a hidden <div> until click Add
> - both the above are included (hidden) in the list view page
> - Edit, Add just make visible the corresponding editable <divs>
> - The Save/Cancel (and 'Delete') buttons do a XmlHttp request
> - The response simply updates part of the DOM
> - No page refreshes at all (in this interaction)
>
> You could use Avi's Javascript to do the XmlHttp round-trip. It would take a
> little additional Javascript, with a tweak to the css, to do the hide/show.
>
> Or is there some underlying design of sessions, continuations, URLs, ids of
> edited objects, the back button, etc. that would make this difficult?
>
>

I would like to second the request for enhancing Nemo with DHTML and
humbly suggest as a starting point for the client side my fork of
Avi's javascript library
http://cvs.sourceforge.net/viewcvs.py/lakeshore/lakeshore/resources/liveUpdater.js?v...
(which is part of a port of Seaside2 to Java
http://lakeshore.source...).

I've been wanting to look into Mewa for a while now. Thank you Howard
for letting me do it without having to fire up squeak ;)

Leslie Hensley


Kevin Howe

1/13/2005 10:46:00 PM

0

> You could use Avi's Javascript to do the XmlHttp round-trip. It would take
a
> little additional Javascript, with a tweak to the css, to do the
hide/show.
>
> Or is there some underlying design of sessions, continuations, URLs, ids
of
> edited objects, the back button, etc. that would make this difficult?

I actually experimented with using XmlHttp for realtime field validation in
Nemo a little while back. There was an issue concerning the way that Wee
keeps it's page history, but I never looked into it deeply since it was just
a side-experiment. I'll see if I can dig up the code.

- Kevin


Michael Neumann

1/13/2005 11:16:00 PM

0

itsme213 wrote:
> Wonderful!
>
> "Michael Neumann" <mneumann@ntecs.de> wrote
>
>>* Can be used with or without continuations
>
>
> Are you recommending that continuations not be used? due to gc issues? other
> reasons?

Exactly! Especially for nested calls, memory (on my configuration) is no
more reclaimed, due to continuations (I guess).
Other disadvantages of continations are:

* Each session must have it's own thread (due to the inability to
call continuations across threads)

* you can't marshal threads nor continations. especially in
combination with memory leaks, this is critical!

Regards,

Michael


Its Me

1/14/2005 12:20:00 AM

0


"Michael Neumann" <mneumann@ntecs.de> wrote

> > Are you recommending that continuations not be used? due to gc issues?
other
> > reasons?
>
> Exactly!

Is the only alternative an explicit request/response style, or is there some
other way you discovered to get a "straight-line code" style even without
continuations?

How about the browser-back button? Works without continuations?

And what features from IOWA do you miss in Wee?

Thanks!


Michael Neumann

1/14/2005 12:51:00 AM

0

itsme213 wrote:
> "Michael Neumann" <mneumann@ntecs.de> wrote
>
>
>>>Are you recommending that continuations not be used? due to gc issues?
>
> other
>
>>>reasons?
>>
>>Exactly!
>
>
> Is the only alternative an explicit request/response style, or is there some
> other way you discovered to get a "straight-line code" style even without
> continuations?

Everything Wee currently supports works without continuations, except
what I describe below.

I'm not sure whether it is possible to implement the live-updates
without continuations as I've not yet gave this a thought. But there's
no problem to register a direct-handler of a component, which gets
called by a URL directly (not traversing the components tree) and which
returns a response. That should be super easy.

> How about the browser-back button? Works without continuations?

Works without continuations. The only thing continuations are currently
used for is:

der render
r.anchor.callback { do_something }.with('click here')
end

def do_something
if call(ConfirmDialog.new('Really Quit?'))
call InformDialog.new('Bye bye')
else
call InformDialog.new('Continue working')
end
end

Without continuations, you have to write:

def do_something
call(ConfirmDialog.new('Really Quit?'), :confirm)
end

def confirm(quit)
if quit
call InformDialog.new('Bye bye')
else
call InformDialog.new('Continue working')
end
end

This example above is just fine without continations, but image a more
complex example.

> And what features from IOWA do you miss in Wee?

Well, I'm not missing anything in Wee ;-)
But I could need some support, especially writing components.
Wee's model is a bit more expensive I guess, but on the other hand, IOWA
could profit from Wee's clean model. And Wee could profit from IOWA, if
there are more people using it ;-)

Regards,

Michael



Michael Neumann

1/14/2005 12:56:00 AM

0

Kevin Howe wrote:
>>You could use Avi's Javascript to do the XmlHttp round-trip. It would take
>
> a
>
>>little additional Javascript, with a tweak to the css, to do the
>
> hide/show.
>
>>Or is there some underlying design of sessions, continuations, URLs, ids
>
> of
>
>>edited objects, the back button, etc. that would make this difficult?
>
>
> I actually experimented with using XmlHttp for realtime field validation in
> Nemo a little while back. There was an issue concerning the way that Wee
> keeps it's page history, but I never looked into it deeply since it was just
> a side-experiment. I'll see if I can dig up the code.

Well, using live-update could change the current components state, but
it would not modify snapshotted state. This means, that a live-update
should not change state that is beeing backtracked, as a live-update
does not generate a new page. With this in mind, there should be no
problem with Wee's pagecache.

Regards,

Michael


Its Me

1/14/2005 7:02:00 PM

0


"Michael Neumann" <mneumann@ntecs.de> wrote

> Well, using live-update could change the current components state, but
> it would not modify snapshotted state. This means, that a live-update
> should not change state that is beeing backtracked, as a live-update
> does not generate a new page.

Is generation of a new page necessarily tied to being able to backtrack?

On the server: Could live_update components override
Component#backtrack_state to have the back-button work even without
page-reloads?

On the client: Will the browser's history need to be manipulated to make the
back button work with live updates?

(asked very tenously as I am not confident of the terminology).

Thanks.