Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Late static bindings
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
  12 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:
Follow-up To:
Add Cc | Add Follow-up 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 that you hear
 
Sailor  
View profile   Translate to Translated (View Original)
 More options 26 June, 21:40
From: Sailor <salim.semao...@gmail.com>
Date: Fri, 26 Jun 2009 13:40:14 -0700 (PDT)
Local: Fri 26 June 2009 21:40
Subject: Late static bindings
Hi all,

I know that Doctrine 2.0 is going to work with only one file per
model.
Is it possible that methods within the ModelTable class can be
declared as static methods (ActiveRecord-like) now that PHP 5.3
supports late static bindings ?

Salim


    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.
Jonathan Wage  
View profile   Translate to Translated (View Original)
 More options 26 June, 22:28
From: Jonathan Wage <jonw...@gmail.com>
Date: Fri, 26 Jun 2009 16:28:22 -0500
Local: Fri 26 June 2009 22:28
Subject: Re: [doctrine-dev] Late static bindings

In Doctrine 2.0 the ModelTable does not exist. Things are pretty different.
But, we haven't begun to think about how or if we will use the late static
binding features of php 5.3

- Jon

On Fri, Jun 26, 2009 at 3:40 PM, Sailor <salim.semao...@gmail.com> wrote:

> Hi all,

> I know that Doctrine 2.0 is going to work with only one file per
> model.
> Is it possible that methods within the ModelTable class can be
> declared as static methods (ActiveRecord-like) now that PHP 5.3
> supports late static bindings ?

> Salim

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com


    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.
Adam Huttler  
View profile   Translate to Translated (View Original)
 More options 26 June, 22:45
From: "Adam Huttler" <adam.hutt...@fracturedatlas.org>
Date: Fri, 26 Jun 2009 17:45:43 -0400 (EDT)
Local: Fri 26 June 2009 22:45
Subject: RE: [doctrine-dev] Re: Late static bindings

The obvious example to be has always been:

$user = User::find($id);

From: doctrine-dev@googlegroups.com [mailto:doctrine-dev@googlegroups.com]
On Behalf Of Jonathan Wage
Sent: Friday, June 26, 2009 5:28 PM
To: doctrine-dev@googlegroups.com
Subject: [doctrine-dev] Re: Late static bindings

In Doctrine 2.0 the ModelTable does not exist. Things are pretty
different. But, we haven't begun to think about how or if we will use the
late static binding features of php 5.3

- Jon

On Fri, Jun 26, 2009 at 3:40 PM, Sailor <salim.semao...@gmail.com> wrote:

Hi all,

I know that Doctrine 2.0 is going to work with only one file per
model.
Is it possible that methods within the ModelTable class can be
declared as static methods (ActiveRecord-like) now that PHP 5.3
supports late static bindings ?

Salim

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related
questions at jonathan.w...@sensio.com


    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.
Roman Borschel  
View profile   Translate to Translated (View Original)
 More options 26 June, 23:04
From: Roman Borschel <r.borsc...@gmx.net>
Date: Sat, 27 Jun 2009 00:04:28 +0200
Local: Fri 26 June 2009 23:04
Subject: Re: [doctrine-dev] Re: Late static bindings

On Jun 26, 2009, at 11:28 PM, Jonathan Wage wrote:

> In Doctrine 2.0 the ModelTable does not exist. Things are pretty  
> different. But, we haven't begun to think about how or if we will  
> use the late static binding features of php 5.3

> - Jon

The thing that comes nearest is probably the EntityRepository.  
However, it doesnt make much sense to add static methods to your own,  
derived repositories, just add normal methods. In fact static methods  
have a downside: harder to test (if at all).

The only use for late static binding is maybe in rails-like  
ActiveRecord implementations but even then you got the problem of  
testability (except if you dont ever want to stub/mock these  
finders...).

I currently dont see a good use for late static binding in doctrine 2.  
Maybe an extension could provide an "ActiveRecord" base class that  
uses it for people who want it but it will not be in the Doctrine 2  
core distribution.

Roman


    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.
Adam Huttler  
View profile   Translate to Translated (View Original)
 More options 26 June, 23:01
From: "Adam Huttler" <adam.hutt...@fracturedatlas.org>
Date: Fri, 26 Jun 2009 18:01:06 -0400 (EDT)
Local: Fri 26 June 2009 23:01
Subject: RE: [doctrine-dev] Re: Late static bindings

Sorry, that should be "to me", not "to be".

From: doctrine-dev@googlegroups.com [mailto:doctrine-dev@googlegroups.com]
On Behalf Of Adam Huttler
Sent: Friday, June 26, 2009 5:46 PM
To: doctrine-dev@googlegroups.com
Subject: [doctrine-dev] Re: Late static bindings

The obvious example to be has always been:

$user = User::find($id);

From: doctrine-dev@googlegroups.com [mailto:doctrine-dev@googlegroups.com]
On Behalf Of Jonathan Wage
Sent: Friday, June 26, 2009 5:28 PM
To: doctrine-dev@googlegroups.com
Subject: [doctrine-dev] Re: Late static bindings

In Doctrine 2.0 the ModelTable does not exist. Things are pretty
different. But, we haven't begun to think about how or if we will use the
late static binding features of php 5.3

- Jon

On Fri, Jun 26, 2009 at 3:40 PM, Sailor <salim.semao...@gmail.com> wrote:

Hi all,

I know that Doctrine 2.0 is going to work with only one file per
model.
Is it possible that methods within the ModelTable class can be
declared as static methods (ActiveRecord-like) now that PHP 5.3
supports late static bindings ?

Salim

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related
questions at jonathan.w...@sensio.com


    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.
Jonathan Wage  
View profile   Translate to Translated (View Original)
 More options 26 June, 23:04
From: Jonathan Wage <jonw...@gmail.com>
Date: Fri, 26 Jun 2009 17:04:55 -0500
Local: Fri 26 June 2009 23:04
Subject: Re: [doctrine-dev] Re: Late static bindings

Since by default models won't extend anything. This won't be something in
the core, but I think we'll have a DoctrineActiveRecord extension that
people can use to give them some cool active record style functionality. It
is yet to be decided tho.

- Jon

On Fri, Jun 26, 2009 at 4:45 PM, Adam Huttler <

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com


    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.
Jonathan Wage  
View profile   Translate to Translated (View Original)
 More options 26 June, 23:15
From: Jonathan Wage <jonw...@gmail.com>
Date: Fri, 26 Jun 2009 17:15:51 -0500
Local: Fri 26 June 2009 23:15
Subject: Re: [doctrine-dev] Re: Late static bindings

I think Roman and I wrote the exact same thing and hit the send button at
the same time lol..

- Jon

--
Jonathan H. Wage (+1 415 992 5468)
Open Source Software Developer & Evangelist
sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

You can contact Jonathan about Doctrine, Symfony and Open-Source or for
training, consulting, application development, or business related questions
at jonathan.w...@sensio.com


    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.
Sailor  
View profile   Translate to Translated (View Original)
 More options 26 June, 23:59
From: Sailor <salim.semao...@gmail.com>
Date: Fri, 26 Jun 2009 15:59:38 -0700 (PDT)
Local: Fri 26 June 2009 23:59
Subject: Re: Late static bindings
Don't you think that it's a little weird to create an object just to
instantiate others ?
Plus, I don't see why it would be harder to test (i'm not a testing
guru ;))

On 27 juin, 00:04, Roman Borschel <r.borsc...@gmx.net> 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.
Roman Borschel  
View profile   Translate to Translated (View Original)
 More options 27 June, 08:53
From: Roman Borschel <r.borsc...@gmx.net>
Date: Sat, 27 Jun 2009 09:53:19 +0200
Local: Sat 27 June 2009 08:53
Subject: Re: [doctrine-dev] Re: Late static bindings
On Jun 27, 2009, at 12:59 AM, Sailor wrote:

> Don't you think that it's a little weird to create an object just to
> instantiate others ?

No, absolutely not.

> Plus, I don't see why it would be harder to test (i'm not a testing
> guru ;))

There's plenty of stuff on google about that: http://www.google.de/search?hl=de&safe=off&q=unit+test+static+methods...

In general, "static" is often considered not good style in an object-
oriented program, though there are some valid uses. Probably the most  
useful scenario are factory methods and thats about the only area  
where you'll find static methods in doctrine 2 I think.

Roman


    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.
Giorgio Sironi  
View profile   Translate to Translated (View Original)
 More options 30 June, 12:56
From: Giorgio Sironi <piccoloprincipeazzu...@gmail.com>
Date: Tue, 30 Jun 2009 13:56:14 +0200
Local: Tues 30 June 2009 12:56
Subject: Re: [doctrine-dev] Re: Late static bindings

On Sat, Jun 27, 2009 at 9:53 AM, Roman Borschel <r.borsc...@gmx.net> wrote:
> In general, "static" is often considered not good style in an object-
> oriented program, though there are some valid uses. Probably the most
> useful scenario are factory methods and thats about the only area
> where you'll find static methods in doctrine 2 I think.

I'm reading the tests for 2.0 branch while grepp'ing for '::' in the lib/
folder. I agree that static methods should be banished after all.

--
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://ossigeno.sourceforge.net


    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.
Bruno Reis  
View profile   Translate to Translated (View Original)
 More options 30 June, 13:09
From: Bruno Reis <bruno.p.r...@gmail.com>
Date: Tue, 30 Jun 2009 09:09:54 -0300
Local: Tues 30 June 2009 13:09
Subject: Re: [doctrine-dev] Re: Late static bindings
In my users opinion, the table factory as it is today does not work
well with IDEs. When I do a Doctrine::getTable('XType'), my IDE does
not know the type of the result, so the missing auto-complete slows
the development time. I have no problem with instatiating a factory to
build a model, but something like User::getFactory()->find() would be
a lot better to the speed of the team if the IDE recognizes the type
of the built object.

2009/6/30 Giorgio Sironi <piccoloprincipeazzu...@gmail.com>:


    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.
Giorgio Sironi  
View profile   Translate to Translated (View Original)
 More options 2 July, 12:38
From: Giorgio Sironi <piccoloprincipeazzu...@gmail.com>
Date: Thu, 2 Jul 2009 13:38:15 +0200
Local: Thurs 2 July 2009 12:38
Subject: Re: [doctrine-dev] Re: Late static bindings

On Tue, Jun 30, 2009 at 2:09 PM, Bruno Reis <bruno.p.r...@gmail.com> wrote:
> I have no problem with instatiating a factory to
> build a model, but something like User::getFactory()->find() would be
> a lot better to the speed of the team if the IDE recognizes the type
> of the built object.

Since the table/repository it's not a template class (which does not exist
in php) it's not possible to provide a @return tag for every possible model,
but if you subclass it you could put the tag you want for autocompletion.

--
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://ossigeno.sourceforge.net


    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