Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35878

Re: Parameterized Factory with additional parameter requires new interface?

From j4n bur53 <janburse@fastmail.fm>
Newsgroups comp.lang.java.programmer
Subject Re: Parameterized Factory with additional parameter requires new interface?
Date 2016-10-28 18:07 +0200
Organization albasani.net
Message-ID <nuvt3j$bks$1@news.albasani.net> (permalink)
References <d1c8beb2-3ef7-4965-afa0-4cb0902c02fb@googlegroups.com> <nuvj57$gus$1@newsreader4.netcologne.de> <nuvprg$5jd$1@dont-email.me>

Show all headers | View raw


Eric Sosman schrieb:
> XXXresource res = ...
> XXXtype t = factory.create(res, "foo");

You could curry differently it:

 > XXXresource res = ...
 > XXXtype t = factory.derive(res).create("foo");

-- OR --

 > XXXresource res = ...
 > XXXtype t = res.derive(factory).create("foo");

In all 3 cases you can use singletons for
factory or res.

But I guess the two parameter create() will save
you some intermediate allocate for the
builder closure.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Parameterized Factory with additional parameter requires new interface? mike <mikaelpetterson@hotmail.com> - 2016-10-27 23:51 -0700
  Re: Parameterized Factory with additional parameter requires new interface? j4n bur53 <janburse@fastmail.fm> - 2016-10-28 10:27 +0200
  Re: Parameterized Factory with additional parameter requires new interface? Andreas Leitgeb <avl@logic.at> - 2016-10-28 11:59 +0000
  Re: Parameterized Factory with additional parameter requires new interface? Patrick Roemer <sangamon@netcologne.de> - 2016-10-28 15:17 +0200
    Re: Parameterized Factory with additional parameter requires new interface? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-10-28 11:12 -0400
      Re: Parameterized Factory with additional parameter requires new interface? j4n bur53 <janburse@fastmail.fm> - 2016-10-28 18:07 +0200
        Re: Parameterized Factory with additional parameter requires new interface? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-10-28 16:43 -0400

csiph-web