You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2007/07/29 21:03:37 UTC

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

On 7/29/07, ehillenius@apache.org <eh...@apache.org> wrote:
>
>         /**
> -        * Marks session state as dirty
> +        * Marks session state as dirty. THIS METHOD SHOULD TYPICALLY NOT
> BE CALLED
> +        * BY CLIENTS; IT IS USED FOR INTERNAL BOOK KEEPING.
>          */
>         public final void dirty()
>         {


is that right? dirty() is there partially for clients. for example:

class mysession extends websession {
  int a=0;

  public void increment() {
    a++;
   dirty();
  }
}

that dirty call in there is necessary in order to mark the session as dirty
so it is pushed into httpsession. so it is there for clients, and they do
have to call it. or am i missing something?

-igor

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Posted by Eelco Hillenius <ee...@gmail.com>.
On 7/29/07, Matej Knopp <ma...@gmail.com> wrote:
> I'd be all for that. Can we do it before 1.3?
>
> IMHO we could. Just rename dirty -> internalDirty, bind->dirty and
> keep bind as deprecated forward to dirty.

Yeah, we can do it right now. You want to do it?

Eelco

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Posted by Matej Knopp <ma...@gmail.com>.
I'd be all for that. Can we do it before 1.3?

IMHO we could. Just rename dirty -> internalDirty, bind->dirty and
keep bind as deprecated forward to dirty.

-Matej

On 7/29/07, Igor Vaynberg <ig...@gmail.com> wrote:
> On 7/29/07, Eelco Hillenius <ee...@gmail.com> wrote:
> >
> > On 7/29/07, Matej Knopp <ma...@gmail.com> wrote:
> > > I'm pretty sure we can't do that transparently unless we do some
> > > bytecode magic.
> >
> > Well, I didn't want to say 'bytecode' as before you know it Igor
> > starts calling me a byte code fan :).
> >
> > > As for bind(); dirty(); i think just bind() should be
> > > enough. If it's not perhaps we should make it mark the session dirty,
> > > as it is imho pretty obvious that something have changed in the
> > > session so that you want to bind it.
> >
> > Yeah, that would be a solution. Igor?
>
>
> sounds wonderful. however bind() is a pretty bad name for what we want.
> dirty() makes more sense. so perhaps we should rename dirty() into
> internaldirty() and have a new dirty() method that internally calls bind();
> internaldirty();
>
> -igor
>
>
>
> Eelco
> >
>

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Posted by Igor Vaynberg <ig...@gmail.com>.
On 7/29/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> On 7/29/07, Matej Knopp <ma...@gmail.com> wrote:
> > I'm pretty sure we can't do that transparently unless we do some
> > bytecode magic.
>
> Well, I didn't want to say 'bytecode' as before you know it Igor
> starts calling me a byte code fan :).
>
> > As for bind(); dirty(); i think just bind() should be
> > enough. If it's not perhaps we should make it mark the session dirty,
> > as it is imho pretty obvious that something have changed in the
> > session so that you want to bind it.
>
> Yeah, that would be a solution. Igor?


sounds wonderful. however bind() is a pretty bad name for what we want.
dirty() makes more sense. so perhaps we should rename dirty() into
internaldirty() and have a new dirty() method that internally calls bind();
internaldirty();

-igor



Eelco
>

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Posted by Eelco Hillenius <ee...@gmail.com>.
On 7/29/07, Matej Knopp <ma...@gmail.com> wrote:
> I'm pretty sure we can't do that transparently unless we do some
> bytecode magic.

Well, I didn't want to say 'bytecode' as before you know it Igor
starts calling me a byte code fan :).

> As for bind(); dirty(); i think just bind() should be
> enough. If it's not perhaps we should make it mark the session dirty,
> as it is imho pretty obvious that something have changed in the
> session so that you want to bind it.

Yeah, that would be a solution. Igor?

Eelco

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Posted by Matej Knopp <ma...@gmail.com>.
I'm pretty sure we can't do that transparently unless we do some
bytecode magic. As for bind(); dirty(); i think just bind() should be
enough. If it's not perhaps we should make it mark the session dirty,
as it is imho pretty obvious that something have changed in the
session so that you want to bind it.

-Matej

On 7/29/07, Eelco Hillenius <ee...@gmail.com> wrote:
> On 7/29/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > On 7/29/07, ehillenius@apache.org <eh...@apache.org> wrote:
> > >
> > >         /**
> > > -        * Marks session state as dirty
> > > +        * Marks session state as dirty. THIS METHOD SHOULD TYPICALLY NOT
> > > BE CALLED
> > > +        * BY CLIENTS; IT IS USED FOR INTERNAL BOOK KEEPING.
> > >          */
> > >         public final void dirty()
> > >         {
> >
> >
> > is that right? dirty() is there partially for clients. for example:
> >
> > class mysession extends websession {
> >   int a=0;
> >
> >   public void increment() {
> >     a++;
> >    dirty();
> >   }
> > }
> >
> > that dirty call in there is necessary in order to mark the session as dirty
> > so it is pushed into httpsession. so it is there for clients, and they do
> > have to call it. or am i missing something?
>
> Yeah, I guess you're right. Which means that it should really be:
>
> class mysession extends websession {
>  int a=0;
>
>  public void increment() {
>    a++;
>   bind();
>   dirty();
>  }
> }
>
> unless you are certain that the session is already bound. It's pretty
> ugly. Would be nice if we could do this transparently somehow.
>
> Eelco
>

Re: svn commit: r560782 - /wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Posted by Eelco Hillenius <ee...@gmail.com>.
On 7/29/07, Igor Vaynberg <ig...@gmail.com> wrote:
> On 7/29/07, ehillenius@apache.org <eh...@apache.org> wrote:
> >
> >         /**
> > -        * Marks session state as dirty
> > +        * Marks session state as dirty. THIS METHOD SHOULD TYPICALLY NOT
> > BE CALLED
> > +        * BY CLIENTS; IT IS USED FOR INTERNAL BOOK KEEPING.
> >          */
> >         public final void dirty()
> >         {
>
>
> is that right? dirty() is there partially for clients. for example:
>
> class mysession extends websession {
>   int a=0;
>
>   public void increment() {
>     a++;
>    dirty();
>   }
> }
>
> that dirty call in there is necessary in order to mark the session as dirty
> so it is pushed into httpsession. so it is there for clients, and they do
> have to call it. or am i missing something?

Yeah, I guess you're right. Which means that it should really be:

class mysession extends websession {
 int a=0;

 public void increment() {
   a++;
  bind();
  dirty();
 }
}

unless you are certain that the session is already bound. It's pretty
ugly. Would be nice if we could do this transparently somehow.

Eelco