Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
java.lang.ref.* in GoogleWebToolkit ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Garo.Garabedyan  
View profile  
(1 user)  More options Nov 18 2008, 2:26 am
From: "Garo.Garabedyan" <garabed...@gmail.com>
Date: Mon, 17 Nov 2008 23:26:38 -0800 (PST)
Local: Tues, Nov 18 2008 2:26 am
Subject: java.lang.ref.* in GoogleWebToolkit ?
http://garabedyan.wordpress.com/2008/11/18/javalangref-in-googlewebto...

Is java.lang.ref.* functioning in GWT? I come to an idea that
java.lang.ref.* is necessary to enable proper garbage collection while
implementing the Observer pattern in Model View Controller.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Morris  
View profile  
(1 user)  More options Nov 18 2008, 6:27 am
From: Jason Morris <lem...@gmail.com>
Date: Tue, 18 Nov 2008 13:27:52 +0200
Local: Tues, Nov 18 2008 6:27 am
Subject: Re: java.lang.ref.* in GoogleWebToolkit ?
You can't use java.lang.ref on the client side, because JavaScript has no notion of weak, soft, or
phantom references. You can however use the java.lang.ref package on the server.

If you need to release objects on the client side, it is best to do so by hand when they are no
longer in use. If you need to also tell the server to release them, use an RPC call of some sort,
and have the server release the data when the session expires (if you are not actually storing the
data in the session).


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Garo.Garabedyan  
View profile  
 More options Nov 19 2008, 8:44 am
From: "Garo.Garabedyan" <garabed...@gmail.com>
Date: Wed, 19 Nov 2008 05:44:55 -0800 (PST)
Local: Wed, Nov 19 2008 8:44 am
Subject: Re: java.lang.ref.* in GoogleWebToolkit ?
I think that by implementing java.lang.ref.* in the client side
(translating to written by hand JavaScript code that adds and can
manages new type of object references) many people can avoid their own
implementation of object release algorithm used to classify the
significant (regular) and not significant (which do not require object
existance at all) object references.

On Nov 18, 2:27 pm, Jason Morris <lem...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Petersen  
View profile  
 More options Nov 19 2008, 10:17 am
From: "Ian Petersen" <ispet...@gmail.com>
Date: Wed, 19 Nov 2008 07:17:57 -0800
Local: Wed, Nov 19 2008 10:17 am
Subject: Re: java.lang.ref.* in GoogleWebToolkit ?

On Wed, Nov 19, 2008 at 5:44 AM, Garo.Garabedyan <garabed...@gmail.com> wrote:
> I think that by implementing java.lang.ref.* in the client side
> (translating to written by hand JavaScript code that adds and can
> manages new type of object references)

I sincerely doubt that is even possible, because:

> On Nov 18, 2:27 pm, Jason Morris <lem...@gmail.com> wrote:
>> You can't use java.lang.ref on the client side, because JavaScript has no notion of weak, soft, or
>> phantom references. You can however use the java.lang.ref package on the server.

The java.lang.ref.* classes work intimately with the JVM to give the
user some insight into the memory management cycle.  The Javascript
"VM" doesn't allow that insight because there's no API for it.
Someone with more theoretical background can correct me if I'm wrong,
but I'm pretty sure the only way to implement java.lang.ref.* in the
browser is to emulate a JVM in Javascript and run GWT on top of that.
That would be an enormous undertaking and it would require
rearchitecting and rewriting all of the client side infrastructure.
In other words, I feel pretty safe saying "it ain't gonna happen".

Ian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Garo.Garabedyan  
View profile  
 More options Nov 20 2008, 9:13 am
From: "Garo.Garabedyan" <garabed...@gmail.com>
Date: Thu, 20 Nov 2008 06:13:32 -0800 (PST)
Local: Thurs, Nov 20 2008 9:13 am
Subject: Re: java.lang.ref.* in GoogleWebToolkit ?
I think that this is possible if you implement a JS code that behaves
like a java.lang.ref.* references between Java objects to be
translation to JS. And I think that this is not a heavy task to
produce a heavy environment. Something like pay-to-use feature.

JS code can be a mediator between objects and let them erase
references when the letter are not needed anymore. A change must be
made in Java-to-JavaScript compiler.

On Nov 19, 6:17 pm, "Ian Petersen" <ispet...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Petersen  
View profile  
 More options Nov 20 2008, 9:42 am
From: "Ian Petersen" <ispet...@gmail.com>
Date: Thu, 20 Nov 2008 06:42:26 -0800
Local: Thurs, Nov 20 2008 9:42 am
Subject: Re: java.lang.ref.* in GoogleWebToolkit ?

On Thu, Nov 20, 2008 at 6:13 AM, Garo.Garabedyan <garabed...@gmail.com> wrote:
> I think that this is possible if you implement a JS code that behaves
> like a java.lang.ref.* references between Java objects to be
> translation to JS. And I think that this is not a heavy task to
> produce a heavy environment. Something like pay-to-use feature.

Yes, if you "implement a JS code that behaves like a java.lang.ref.*
reference", then you've implemented java.lang.ref.* and the rest of
your requests are trivial.  Jason Morris and I have already tried to
highlight the impossibility of implementing any such thing.  The
Javascript interpreter doesn't provide any hooks for doing what you're
asking.

If you want to get all technical, Javascript is a Turing-complete
language so you could, in principle, simulate an entire JVM and run
.class files on top of that.  Do so would be largely ludicrous--if you
want to run Java in the browser, write an applet and run Java in the
browser, don't reinvent the wheel badly.

Restricting ourselves to things that have a chance of being
incorporated into GWT leaves us with the conclusion that
java.lang.ref.* can't and won't be done.

> JS code can be a mediator between objects and let them erase
> references when the letter are not needed anymore.

I don't understand what you mean here.  Javascript code is nothing
except a mediator between objects because Javascript is an
object-oriented language.  Every single Javascript program ever
written and ever to be written will do nothing _except_ mediate
objects.  That doesn't give such programs some kind of magical ability
to peer into the Javascript interpreter and divine when a particular
reference is no longer needed.

> A change must be
> made in Java-to-JavaScript compiler.

No, a change must be made in your design such that you no longer need
or want java.lang.ref.* because the Java-to-Javascript compiler can't
create features in the Javascript interpreter.

Ian


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Garo.Garabedyan  
View profile  
 More options Dec 29 2008, 9:22 am
From: "Garo.Garabedyan" <garabed...@gmail.com>
Date: Mon, 29 Dec 2008 06:22:11 -0800 (PST)
Local: Mon, Dec 29 2008 9:22 am
Subject: Re: java.lang.ref.* in GoogleWebToolkit ?
I think that mediation of objects by JS can be designed in such a way
to understand when a particular object (by the count of references to
it) is no longer needed to the rest objects.
http://www.slideshare.net/Adieu/advanced-javascript/

On Nov 20, 5:42 pm, "Ian Petersen" <ispet...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google