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


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

Re: borrowing Constants

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!colt.net!news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Date Fri, 23 Sep 2011 20:44:21 -0400
From Arne Vajhøj <arne@vajhoej.dk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: borrowing Constants
References <cf9q77h3gnhunlqpckpsobog4oqvlhiga7@4ax.com>
In-Reply-To <cf9q77h3gnhunlqpckpsobog4oqvlhiga7@4ax.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Lines 32
Message-ID <4e7d27e8$0$290$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source
NNTP-Posting-Host 72.192.23.141
X-Trace news.sunsite.dk DXC=cQnV4k=DhX0:YiKBaBLXD=YSB=nbEKnk;6X8oV9af9K:JPe3\kP5EU1KBm9cfh9BS4M2;kT<[:>[1<k4;o]l7K:2gBX`nTACMA4
X-Complaints-To staff@sunsite.dk
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8246

Show key headers only | View raw


On 9/23/2011 8:40 PM, Roedy Green wrote:
> If you have some code like this:
>
> class A
> {
>   static String VERSION = "1.0b";
> }
>
> and
> class B
> {
> static String VERSION = A.VERSION;
> }
>
> When you use Class B, does all of class A get instantiated?

I don't think it can just initialize what is needed.

The overhead must be microscopic anyway.

> Does all of class A get put in B's jar?

That depends on the one doing the "putting".

> If so, it suggests you are better off to have a tiny common class and
> have A and B reference it.

You should stick to good design and keep the versions where they
logical belong.

Arne

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


Thread

borrowing Constants Roedy Green <see_website@mindprod.com.invalid> - 2011-09-23 17:40 -0700
  Re: borrowing Constants Arne Vajhøj <arne@vajhoej.dk> - 2011-09-23 20:44 -0400
    Re: borrowing Constants Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-09-23 22:10 -0300
      Re: borrowing Constants Roedy Green <see_website@mindprod.com.invalid> - 2011-09-23 18:39 -0700
        Re: borrowing Constants Arne Vajhøj <arne@vajhoej.dk> - 2011-09-23 22:17 -0400
        Re: borrowing Constants Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-09-25 11:25 -0700
          Re: borrowing Constants Lew <lewbloch@gmail.com> - 2011-09-25 11:36 -0700
      Re: borrowing Constants Arne Vajhøj <arne@vajhoej.dk> - 2011-09-23 22:30 -0400
  Re: borrowing Constants Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-23 21:15 -0400
    Re: borrowing Constants Roedy Green <see_website@mindprod.com.invalid> - 2011-09-23 18:43 -0700
  Re: borrowing Constants markspace <-@.> - 2011-09-23 18:44 -0700
    Re: borrowing Constants Lew <lewbloch@gmail.com> - 2011-09-23 19:19 -0700
    Re: borrowing Constants Arne Vajhøj <arne@vajhoej.dk> - 2011-09-23 22:32 -0400
  Re: borrowing Constants Lew <lewbloch@gmail.com> - 2011-09-23 19:11 -0700
    Re: borrowing Constants Lew <lewbloch@gmail.com> - 2011-09-23 19:26 -0700
  Re: borrowing Constants v_borchert@despammed.com (Volker Borchert) - 2011-09-24 09:44 +0000
  Re: borrowing Constants Roedy Green <see_website@mindprod.com.invalid> - 2011-09-24 15:38 -0700
  Re: borrowing Constants Roedy Green <see_website@mindprod.com.invalid> - 2011-09-24 17:09 -0700
    Re: borrowing Constants Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-24 20:14 -0400
    Re: borrowing Constants markspace <-@.> - 2011-09-24 18:18 -0700
      Re: borrowing Constants Arne Vajhøj <arne@vajhoej.dk> - 2011-09-25 22:36 -0400
    Re: borrowing Constants Arne Vajhøj <arne@vajhoej.dk> - 2011-09-25 22:35 -0400
  Re: borrowing Constants Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-09-26 01:22 +0200

csiph-web