« 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 Stepan Koltsov-2 :: Rate this Message:

Reply to Author | View in Thread

Why not just call apply method of companion object, without "new"?

S.

On Sat, Mar 14, 2009 at 17:05, David MacIver <david.maciver@...> 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.
>
> http://www.drmaciver.com/factories-sip.xhtml

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