Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #29751 > unrolled thread
| Started by | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| First post | 2014-08-19 17:32 -0700 |
| Last post | 2014-08-20 09:39 -0700 |
| Articles | 5 on this page of 25 — 8 participants |
Back to article view | Back to comp.lang.java.programmer
JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-19 17:32 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-19 18:47 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Wayne <nospam@all.invalid> - 2014-08-19 23:24 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-19 20:54 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Wayne <nospam@all.invalid> - 2014-08-20 09:24 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-21 00:20 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released thinbluernime <thinbluernime3@gmail.com> - 2014-08-21 15:11 +0000
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Arne Vajhøj <arne@vajhoej.dk> - 2014-08-22 16:10 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-08-23 02:18 +0100
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Arne Vajhøj <arne@vajhoej.dk> - 2014-08-22 21:32 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Arne Vajhøj <arne@vajhoej.dk> - 2014-08-22 16:10 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-21 00:20 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Wayne <nospam@all.invalid> - 2014-08-21 23:54 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Jan Burse <janburse@fastmail.fm> - 2014-08-21 10:18 +0200
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Wayne <nospam@all.invalid> - 2014-08-21 05:37 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Jan Burse <janburse@fastmail.fm> - 2014-08-21 11:43 +0200
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Arne Vajhøj <arne@vajhoej.dk> - 2014-08-22 16:12 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-20 00:32 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Arne Vajhøj <arne@vajhoej.dk> - 2014-08-20 09:45 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-20 08:22 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-20 08:28 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Arne Vajhøj <arne@vajhoej.dk> - 2014-08-20 13:20 -0400
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Joerg Meier <joergmmeier@arcor.de> - 2014-08-21 01:53 +0200
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released markspace <markspace@nospam.nospam> - 2014-08-21 08:42 -0700
Re: JDK 1.8.0_20 and JDK 1.7.0_67 released Roedy Green <see_website@mindprod.com.invalid> - 2014-08-20 09:39 -0700
Page 2 of 2 — ← Prev page 1 [2]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-08-20 08:28 -0700 |
| Message-ID | <bff9v91pluj4abhkubcleudt4cd24v9mf1@4ax.com> |
| In reply to | #29764 |
On Wed, 20 Aug 2014 09:45:11 -0400, Arne Vajhøj <arne@vajhoej.dk> wrote, quoted or indirectly quoted someone who said : > >You should have taken the advice of Joshua Bloch and used >composition instead of inheritance. The advantage of inheritance is you only have to override a small number of methods. With composition, you need to wrap everything you want to expose. With composition, you have control over what is exposed. If a new method appears in the base class it will not be automatically exposed. That could be a good or a bad thing. The big problem with inheritance is the base class ALSO uses your overridden version, not just the clients. That may interfere with the inner workings. -- Roedy Green Canadian Mind Products http://mindprod.com Errors using inadequate data are much less than those using no data at all. ~ Charles Babbage (born: 1791-12-26 died: 1871-10-18 at age: 79)
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2014-08-20 13:20 -0400 |
| Message-ID | <53f4d8f4$0$297$14726298@news.sunsite.dk> |
| In reply to | #29766 |
On 8/20/2014 11:28 AM, Roedy Green wrote: > On Wed, 20 Aug 2014 09:45:11 -0400, Arne Vajhøj <arne@vajhoej.dk> > wrote, quoted or indirectly quoted someone who said : >> You should have taken the advice of Joshua Bloch and used >> composition instead of inheritance. > > The advantage of inheritance is you only have to override a small > number of methods. With composition, you need to wrap everything you > want to expose. From a practical perspective many IDE's can generate all the delegating methods. Arne
[toc] | [prev] | [next] | [standalone]
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Date | 2014-08-21 01:53 +0200 |
| Message-ID | <12so0mwc2omoe$.er48ty5vst88.dlg@40tude.net> |
| In reply to | #29766 |
On Wed, 20 Aug 2014 08:28:04 -0700, Roedy Green wrote:
> On Wed, 20 Aug 2014 09:45:11 -0400, Arne Vajhøj <arne@vajhoej.dk>
> wrote, quoted or indirectly quoted someone who said :
>>You should have taken the advice of Joshua Bloch and used
>>composition instead of inheritance.
> The advantage of inheritance is you only have to override a small
> number of methods. With composition, you need to wrap everything you
> want to expose.
> With composition, you have control over what is exposed. If a new
> method appears in the base class it will not be automatically exposed.
> That could be a good or a bad thing.
Welcome to Lombok's @Delegate:
public Bla {
@Delegate
private final List<String> names = new ArrayList<String>();
}
Bla bla = new Bla();
bla.add("Tadaa!");
<http://projectlombok.org/features/Delegate.html>
Liebe Gruesse,
Joerg
--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.
[toc] | [prev] | [next] | [standalone]
| From | markspace <markspace@nospam.nospam> |
|---|---|
| Date | 2014-08-21 08:42 -0700 |
| Message-ID | <lt541r$opp$1@dont-email.me> |
| In reply to | #29775 |
On 8/20/2014 4:53 PM, Joerg Meier wrote:
> Welcome to Lombok's @Delegate:
>
> public Bla {
> @Delegate
> private final List<String> names = new ArrayList<String>();
> }
I've had for a while now a similar idea for Java
public class Bla implements List<String>(names) {
private names = new ArrayList<String>();
}
Etc.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-08-20 09:39 -0700 |
| Message-ID | <6oj9v91373nuk8psg0vcldgfqjpspfs3ff@4ax.com> |
| In reply to | #29764 |
On Wed, 20 Aug 2014 09:45:11 -0400, Arne Vajhøj <arne@vajhoej.dk> wrote, quoted or indirectly quoted someone who said : > >You should have taken the advice of Joshua Bloch and used >composition instead of inheritance. I have written a little essay on the advantages and disadvantages of composition and inheritance. See http://mindprod.com/jgloss/compositionvsinheritance.html You might want to suggest some improvements. -- Roedy Green Canadian Mind Products http://mindprod.com Errors using inadequate data are much less than those using no data at all. ~ Charles Babbage (born: 1791-12-26 died: 1871-10-18 at age: 79)
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.java.programmer
csiph-web