« Return to Thread: Draft SIP: From constructors to factories: Uniform treatment of object creation

Re: Draft SIP: From constructors to factories: Uniform treatment of object creation

by Martin Odersky :: Rate this Message:

Reply to Author | View in Thread

On Tue, Mar 24, 2009 at 1:16 AM, Raoul Duke <raould@...> wrote:
>>> Summary: Make it easy to switch from constructors to factories after
>>> the fact by adding a mechanism where "new Foo(stuff)" can translate to
>>> an invocation of a user defined method on the companion object.
>
> could we instead just try to do away with 'new' pretty please perhaps?
>
I also think that would be the nicer generalization. I have not
thought about this or the SIP too much recently. So I'm not quite sure
what to think of it.

Cheers

 -- Martin

 « Return to Thread: Draft SIP: From constructors to factories: Uniform treatment of object creation