comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * CPU increasing slowly up to 100% - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3970cf07d01d1d5c * Alternative to InstallAnywhere Now? - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/42f0205528bd98d8 * Java .class Questions - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6242cdeea384eb9a * Am I the only one who questions JSTL, Struts Tags, XSL Tags? - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48683f1f07068c7d * Where to find web game programmer? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/373dd7fcaa6572c2 * How can we beat team system? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b4b3138168ddab7b * Challenge: Triangles puzzle - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e013ca5d7daa5f0 * Eclipse plugin like this?? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/953bcbdd9564916a * license question? - 4 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d7680dfef2acffd6 * inheritance and object creation - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3aa79a7b125fbdbb * Find all implementing classes in classpath? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/db894e13020738bd * building an object index - data structure question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a06239c8e3bcc672 * retroweaver - anyone had a go at fixing it for current jdk1.5.0 release? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/747320088e6854dd ========================================================================== TOPIC: CPU increasing slowly up to 100% http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3970cf07d01d1d5c ========================================================================== == 1 of 3 == Date: Sat, Oct 16 2004 5:20 pm From: "Filip Larsen" <[EMAIL PROTECTED]> SLL wrote > We have 3 JVM installed on a 4 CPU server running Windows 2000 server. > JVM is Sun 1.4.2_04. > Under constant load, the cpu usage is SLOWLY increasing from 5% up to > 100% in 20-30 hours. The cpu increase is not linear, but parabolic. > The cpu usage is equally distributed on the 3 JVM (33% each). > Memory usage per JMV remains constant (300-400 MB). > We already have investigated the Garbage Collector behavior and seams > not to be an issue, because the GC interval and the time used fo GC > are constant and <100 ms. > When we restart 1 of the 3 JVMs, the CPU usage suddenly decrease to 5% > and the observed behavoir restart again. Perhaps your processes are making linear processing through ever increasing lists? If I were in your place I would probably pull out a profiler about now and start measuring where time was spend. With your system setup it sounds like profiling should be an exercise done on regular basis, even if everything seems to run smoothly. Regards, -- Filip Larsen == 2 of 3 == Date: Sat, Oct 16 2004 10:49 pm From: Paul Lutus <Paul Lutus <[EMAIL PROTECTED]>> SLL wrote: > Hi all. > We have 3 JVM installed on a 4 CPU server running Windows 2000 server. > JVM is Sun 1.4.2_04. > Under constant load, the cpu usage is SLOWLY increasing from 5% up to > 100% in 20-30 hours. The cpu increase is not linear, but parabolic. I believe you mean exponential. "Parabolic" would mean the usage would begin by climbing very steeply, level off, and then fall, like the path of a thrown ball. > The cpu usage is equally distributed on the 3 JVM (33% each). > Memory usage per JMV remains constant (300-400 MB). > We already have investigated the Garbage Collector behavior and seams > not to be an issue, because the GC interval and the time used fo GC > are constant and <100 ms. This strongly implies that some object references are not being released for garbage collection. > When we restart 1 of the 3 JVMs, the CPU usage suddenly decrease to 5% > and the observed behavoir restart again. Tell us if this is a new problem with existing software, or a new problem with new software. Tell us if you have access to, and control over, the source code for the software. -- Paul Lutus http://www.arachnoid.com == 3 of 3 == Date: Sat, Oct 16 2004 10:56 pm From: "Tony Morris" <[EMAIL PROTECTED]> > > The cpu usage is equally distributed on the 3 JVM (33% each). > > Memory usage per JMV remains constant (300-400 MB). > > We already have investigated the Garbage Collector behavior and seams > > not to be an issue, because the GC interval and the time used fo GC > > are constant and <100 ms. > > This strongly implies that some object references are not being released for > garbage collection. eh? How does memory remaining constant imply that? I'm speculating that there is some sort of linear structure that is growing over time e.g. a linear search cache (doesn't sound nice, but I've seen it done). One can only speculate. -- Tony Morris http://xdweb.net/~dibblego/ ========================================================================== TOPIC: Alternative to InstallAnywhere Now? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/42f0205528bd98d8 ========================================================================== == 1 of 2 == Date: Sat, Oct 16 2004 5:49 pm From: Bill Tschumy <[EMAIL PROTECTED]> On Wed, 13 Oct 2004 08:43:06 -0500, Chas Douglass wrote (in article <[EMAIL PROTECTED]>): > Bill Tschumy <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > [snip] >> I can't afford the $2000 they now want for InstallAnywhere. If they >> had the old InstallAnywhere Now for (say) $200 I definitely buy it. >> > > I agree with you completely, here. > >> I can't continue to use the old InstallAnywhere Now because it does >> not recognize Java 1.5 and configure the app to run with it. > > [snip] > > I'm not sure what you mean by 'recognize java 1.5 and configure the app to > run with it'. > > I have successfully built an InstallAnywhere installer with non-bundled VM > that was a 1.5 app. I have "IA 5.5 Now". That's the version I have as well. Well, maybe I'll need to experiment a bit more. I installed Java 1.5 along side 1.4. When I ran the installer, it located the 1.4 installation and configured the .lax file to run using 1.4. I had assumed it would pick up the most recent Java available but it did not. Is there some setting I need to set to tell it that 1.5 is permissible? > > I notice in the InstallAnywhere docs that you can build your own VM bundle, > but I haven't tried it yet. Won't that work? It might, but that is a big download to force on the users. I would rather let them use the one that they already have (if they do indeed have it). > > I recently evaluated 3 or 4 free or cheap installers by googling "java > installer". I suggest you do that. I have developed a list. I was just looking for additional pointers from the group. Thanks, > > Chas Douglass -- Bill Tschumy Otherwise -- Austin, TX http://www.otherwise.com == 2 of 2 == Date: Sat, Oct 16 2004 7:38 pm From: Bill Tschumy <[EMAIL PROTECTED]> On Sat, 16 Oct 2004 19:49:16 -0500, Bill Tschumy wrote (in article <[EMAIL PROTECTED]>): > On Wed, 13 Oct 2004 08:43:06 -0500, Chas Douglass wrote > (in article <[EMAIL PROTECTED]>): > >> >> I'm not sure what you mean by 'recognize java 1.5 and configure the app to >> run with it'. >> >> I have successfully built an InstallAnywhere installer with non-bundled VM >> that was a 1.5 app. I have "IA 5.5 Now". > > That's the version I have as well. Well, maybe I'll need to experiment a bit > more. I installed Java 1.5 along side 1.4. When I ran the installer, it > located the 1.4 installation and configured the .lax file to run using 1.4. > I had assumed it would pick up the most recent Java available but it did not. > Is there some setting I need to set to tell it that 1.5 is permissible? > I just tried adding a panel where you allow your user to choose the VM the app runs with. With this panel, it does list the 1.5 VM and allows you to choose it. This is an acceptable solution for me. Without the panel it would automatically choose the latest VM (exclusive of 1.5). Great! This allows me to postpone the search for a new installer a bit longer <g>. -- Bill Tschumy Otherwise -- Austin, TX http://www.otherwise.com ========================================================================== TOPIC: Java .class Questions http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6242cdeea384eb9a ========================================================================== == 1 of 2 == Date: Sat, Oct 16 2004 5:53 pm From: [EMAIL PROTECTED] (Ben) Hello, I have a .class file that I need to run, but I don't have access to the .java file. My first question is whether I will be able to use the functions in this .class file (I'm pretty new to Java and don't quite understand the extension system yet). My second question is what I have to do in Visual J++ to be able to access the functions in this class. Do I have to import it somewhere? Or perhaps include it? Or add it as a component for the compiler? I'd appreciate any help. Thanks, Ben == 2 of 2 == Date: Sat, Oct 16 2004 9:32 pm From: "Paul & Neelam Checknita" <[EMAIL PROTECTED]> You would most certainly need to know the package structure of the class. EG, if the class belonged to package: com.companyname.utils, and the class name is CoUtils, then what you could do is create a folder structure reflecting the package structure as follows: /classes/com/companyname/utils put the class in that folder. You can jar it up, or should be able to simply add the /classes folder to your classpath. The object that uses the compiled class will need to import it as follows: import com.companyname.utils.CoUtils; you should then be able to reference the methods in CoUtils class. NC "Ben" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I have a .class file that I need to run, but I don't have access to > the .java file. My first question is whether I will be able to use > the functions in this .class file (I'm pretty new to Java and don't > quite understand the extension system yet). > > My second question is what I have to do in Visual J++ to be able to > access the functions in this class. Do I have to import it somewhere? > Or perhaps include it? Or add it as a component for the compiler? > > I'd appreciate any help. > > Thanks, > Ben ========================================================================== TOPIC: Am I the only one who questions JSTL, Struts Tags, XSL Tags? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48683f1f07068c7d ========================================================================== == 1 of 3 == Date: Sat, Oct 16 2004 5:56 pm From: [EMAIL PROTECTED] (Greg Smith) > Granted, tags don't <em>generally</em> do a good job of handling > complex logic. Then again, most applications only require basic > control flow. > It seems that you're digging in your heels and trying to come up > with specific examples where scriptlet code looks more "elegant". > You're ignoring the fact that when you have a division of labour > and the HTML coders are not Java programmers then you don't want > to "pollute" the HTML with Java. It's as simple as that. > One should always choose their battles carefully. In this case, > you might want to just go with the flow and accept the standard > approach. Everyone will be happier for it. i've only worked on projects where HTML comes from HTML designers and programmers insert logic. i've never seen a page with logic worked on by a designer. maybe thats why i dont see the advantage to working exclusively with tags. i'm not really "digging in my heels" - rather my "spidey sense" is tingling when i see something like the "OR" example that is not easily defined. after all, OR is a fairly simple construct (try XOR). secondly, i see multiple implementations of IF statements among differing taglibs. this also sets my "spidey sense" tingling. why isnt <c:if> sufficient? why is there also a <x:if>? in contrast, we have no need to redefine the if() conditional in java just because we add a new class. doesnt that set your "spidey sense" tingling too? as for choosing my battles carefully, and going with the flow, thats not ever been my style. no doubt taglibs are the preferred method of building jsps. i have no problem using taglibs that extend the capability of JSP. i'm not proposing abolishing taglibs. what i am saying is that we should be using Java for control structures - its what Java is good at. clearly if my employer requires the exclusive use of taglibs, i'm able to do it, willingly. i dont really feel like a heritic. i just dont get the whole premise that Java in the JSP is a bad thing. and since we continually reinvent control structures for each new taglib, it seems we have a flawed paradigm. == 2 of 3 == Date: Sat, Oct 16 2004 6:05 pm From: [EMAIL PROTECTED] (Greg Smith) "Ben_" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > The problem with java scriptlets and declarations in JSP is that it is > considered to make the source more difficult to read, non-XML and it opens > the door to the fanciest thing a developer can code. > > As it is considered bad practice to code in a JSP, the JSP spec has evolved > to make the source an XML file and taglibs have appeared to make the java > code disappear from the JSP. > > There is actually a need for tests and iterations in JSP, hence the need for > the corresponding taglibs. > > Is it an "offense" to the language that taglibs have gone to the JCP and > have been intregrated in J2EE ? I don't think so, because the embracement by > the community of developers and the recognition of the existence of this > need by the JCP is the sign that there is a place for it. > > OTOH, it's always possible to abuse things. And like it is possible to abuse > JSP by placing much java logic in it, it is possible to abuse taglibs. > > Ben. ben, this is a most reasoned and level response, which i appreciate. surely not all the responses i've received on this topic (mostly outside this group) have been so. i have posted other responses extending my position. as i have said elsewhere, i'm not against tags, just the use of control structures in tags. alternatively, if JSTL could be defined in such a way that we'd never see another set of control structures in taglibs, i'd be happy. although it might be more cumbersome than programming in Java, it would at least be the last time i would have to relearn control structures in JSP. greg == 3 of 3 == Date: Sat, Oct 16 2004 6:35 pm From: Sudsy <[EMAIL PROTECTED]> Greg Smith wrote: <snip> > as for choosing my battles carefully, and going with the flow, thats > not ever been my style. no doubt taglibs are the preferred method of > building jsps. i have no problem using taglibs that extend the > capability of JSP. i'm not proposing abolishing taglibs. what i am > saying is that we should be using Java for control structures - its > what Java is good at. clearly if my employer requires the exclusive > use of taglibs, i'm able to do it, willingly. > > i dont really feel like a heritic. i just dont get the whole premise > that Java in the JSP is a bad thing. and since we continually reinvent > control structures for each new taglib, it seems we have a flawed > paradigm. I guess it comes down to how you design the application. I'm not trying to dodge anything here, merely noting that if you have complex logic to execute then it properly belongs in the servlet, not the JSP. As I mentioned previously, JSP is all about presentation. About the only logic I generally incorporate involves checking for roles or errors and displaying accordingly. Remember that the servlet has the choice as to which page to forward to; don't try to make a single page suffice for all situations when you can instead have multiple processing paths. Such an approach would obviate the need for complex logic processing at the page level, don't you think? -- Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development. ========================================================================== TOPIC: Where to find web game programmer? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/373dd7fcaa6572c2 ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 6:08 pm From: [EMAIL PROTECTED] (Basic) Where is the best place for me to find a java programmer to write a few games for a website? These would be mostly casino style games that would interact with our existing database to take advantage of the points/tokens our users already have obtained. Please email me if interested, or, send me to the best place to find such a person or group of people.. c b r o m l e y @ g m a i l . c o m ========================================================================== TOPIC: How can we beat team system? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b4b3138168ddab7b ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 6:35 pm From: [EMAIL PROTECTED] (Peter) Andrew Thompson <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > On 16 Oct 2004 07:19:06 -0700, Peter wrote: > > > The visual studio 2005 will build in a cvs called "team system". > > What are the features we need to have to beat it? > > (shrugs) A big stick? Not using it? > Does this have anything to do with Java? yes, seem nobody is going to use java to beat it ========================================================================== TOPIC: Challenge: Triangles puzzle http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e013ca5d7daa5f0 ========================================================================== == 1 of 3 == Date: Sat, Oct 16 2004 6:47 pm From: [EMAIL PROTECTED] (Raymond Martineau) On Sat, 16 Oct 2004 23:29:52 +0200, "Yogo" <n o s p a m> wrote: >> Sorry, but i do not agree with your solution. >> You missed many triangles. >> >> E.g., P0 -> P8 -> P5 -> P0 is a triangle of zero area. >> but it is not counted in th solution of 27. > >hmm... > >What are you talking about? > >A triangle with an area equal to zero doesn't exist. Not as far as a computer is concerned. Without any form of sanity checking, the most intuitive (read: quickest for the programmer to implement) definition of a triangle for a computer is a set of three points. The puzzle in question only considers triangles to be formed from a given set of points, as well requiring a known line connecting between those points. Although the puzzle didn't define triangle, the webpage now includes an update that requires these traingle to have an area. >A triangle has three >angles and none of them may be equal to zero, otherwise you just don't have >a triangle. > >What you describe with P0 -> P8 -> P5 -> P0 is a segment of a line not a >triangle... Using the "three angles" definition, the line given is valid. There are three angles in the shape: P5 -> P0 -> P8 : 0 degree angle P0 -> P5 -> P8 : 180 degree angle P0 -> P8 -> P5 : 0 degree angle. 0 degrees is still an angle, as is 180. These angles are generally significant as they indicate parallel lines, but can be valid in figures. == 2 of 3 == Date: Sat, Oct 16 2004 10:11 pm From: [EMAIL PROTECTED] (Tayssir John Gabbour) Frank Buss <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > I've setup a challenge, mainly for C++, Java and Lisp, but every other > language is welcome: > > http://www.frank-buss.de/challenge/index.html > > There is nothing to win, but I hope there will be some interesting > solutions at the end, so the win are the results :-) Would it be possible for you to have a private mailing list where you can show us peoples' submissions? I'm too impatient to wait until the 25th. The recipients can be people who already sent you solutions. It is interesting to see how one programs differently when shipping time is a factor. After I sent it to you and took a quick look at the code, I realized I left in parameters named "blah". ;) Which is what I frequently name things, but I always rename them. MfG, Tayssir == 3 of 3 == Date: Sat, Oct 16 2004 10:31 pm From: "Jeff" <[EMAIL PROTECTED]> Tayssir John Gabbour wrote: > It is interesting to see how one programs differently when shipping > time is a factor. After I sent it to you and took a quick look at the > code, I realized I left in parameters named "blah". ;) Which is what I > frequently name things, but I always rename them. How very true. I'm also curious to see if anyone comes up with a "general case" solution to the problem. I'm in the console gaming industry, where most of the time hard-coding a solution to a specific problem is preferable -- which is why I did in this case. Jeff M. ========================================================================== TOPIC: Eclipse plugin like this?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/953bcbdd9564916a ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 6:55 pm From: "Henrique Seganfredo" <[EMAIL PROTECTED]> Hey folks, is there any Eclipse plugin that supports WYSIWYG web app development within JSF components like Java Studio Creator (Rave)???? Many thanks, -- Henrique Seganfredo ========================================================================== TOPIC: license question? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d7680dfef2acffd6 ========================================================================== == 1 of 4 == Date: Sat, Oct 16 2004 6:39 pm From: "Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> In <[EMAIL PROTECTED]>, on 10/13/2004 at 07:01 PM, [EMAIL PROTECTED] (Peter) said: > So my company is ok to include GPL/LGPL product in our product, >and we still can distribute our product in closed-source. But if i do >that, the court still have arguement? The Devil is in the details. You need to involve your legal staff in the packaging to ensure that you comply with the [L]GPL. I know of no court case involving the GPL where there wasn't a real violation. I see no reason to worry as long as you understand the rules and ensure that they are followed. -- Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel> Unsolicited bulk E-mail subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply to [EMAIL PROTECTED] == 2 of 4 == Date: Sat, Oct 16 2004 6:43 pm From: "Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> In <[EMAIL PROTECTED]>, on 10/13/2004 at 07:20 PM, [EMAIL PROTECTED] (Peter) said: >OKOK , i understand now, the key point is "modified" and >"unmodified". No! That's a secondary issue. If you modify it then you must provide source code for the modification, but theat has *NOTHING* to do with the dynamic versus static issue. -- Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel> Unsolicited bulk E-mail subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply to [EMAIL PROTECTED] == 3 of 4 == Date: Sat, Oct 16 2004 7:09 pm From: "Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> In <[EMAIL PROTECTED]>, on 10/15/2004 at 09:06 AM, [EMAIL PROTECTED] (Steve Schefter) said: > Linus opinion on this is irrelevant. Neither I nor the FSF nor > many others have released code under anything but the vanilla GPL. > By merging such code Linus lost his ability to vary the license. What do you mean by "such code"? What code is Linus distributing under the kernel GPL that he does not have the right to so distribute? Don't confuse Linux with a Linux distribution. -- Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel> Unsolicited bulk E-mail subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply to [EMAIL PROTECTED] == 4 of 4 == Date: Sat, Oct 16 2004 6:52 pm From: "Shmuel (Seymour J.) Metz" <[EMAIL PROTECTED]> In <[EMAIL PROTECTED]>, on 10/14/2004 at 11:47 AM, [EMAIL PROTECTED] (P.T. Breuer) said: >Why? Linking is one of the oldest and best defined concepts in >computer science. It's the pass in which symbolic references in the >code are replaced by addresses. Or supplemented. There is no requirement to remove the names of the symbolic references. IBM's Linkage Editor and Binder, for instance, are fully capable[1] of relinking, including adding, deleting and replacing sections. [1] Unless someone specifies the not editable (NE) option, but that's rare. -- Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel> Unsolicited bulk E-mail subject to legal action. I reserve the right to publicly post or ridicule any abusive E-mail. Reply to domain Patriot dot net user shmuel+news to contact me. Do not reply to [EMAIL PROTECTED] ========================================================================== TOPIC: inheritance and object creation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3aa79a7b125fbdbb ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 8:58 pm From: [EMAIL PROTECTED] (Malcolm Dew-Jones) mank ([EMAIL PROTECTED]) wrote: : I have a class A which is very big (around 500 lines of code). Now I : have to add extra functionality to the class(for which I hv to add a : method of 150 lines of code). : I don't want to cluster the class A even more. I may need to create : Class B having those 150 lines of code and then have a public method : loadDatamethod()and then I have following options, which one is : better ? : 1. let class A inherit class B and call method loadDatamethod() : wherever reqd. (I think you meant class B inherit from class A) : 2. In class A, Instantiate class B and call the appropriate method. : 3. Make the method loadDatamethod() static and then in Class A, call : it B.loadDatamethod(). The advantage is, we don't have to create an : instance of class B. : Any other option? : What are the advantages and disadvantages of these and when should one : be used over the another? * The class should have the code that belongs with the class, no matter how large the class is. You should use an object method to implement the behaviour of an object. You should use a static method then the method acts on the class, or when the class itself is simply a way to group related things together. * So, you should only use 1. if the new class is just a more specific example of the original class. (Which I doubt, but can't know for sure based on this description). You should use 2. if the new method is part of the behaviour of a new kind of object. (Which I doubt from the fact that you say you could write it as a static method.) I suspect you should use 3. In fact I suspect that various algorithms that are useful to class A and currently part of class A should be moved into one of more utility classes so that class A performs only those tasks related to the "objectness" of class A, and leaves processing details that have nothing to do with class A's "objectness" in another class. (I'm not sure I said that very well.) $0.04 ========================================================================== TOPIC: Find all implementing classes in classpath? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/db894e13020738bd ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 7:58 pm From: Martha Goys <[EMAIL PROTECTED]> Andrew Thompson wrote: > On Sat, 16 Oct 2004 00:21:51 -0700, Martha Goys wrote: > >>Sorry if this is a "Classloader 101"-type question, but is there a way >>to programatically find all classes (in the current classpath) > > No. > >>..that implement an interface? > > Yes. > > There is no way to find all the classes on the current classpath, > but if you have a list of classes it is possible to determine if > any implement a particular interface. > > Why do you feel you need to do this? What is the end result > you wish to achieve? > I'd like to list all classes implementing a certain interface in a UI, so that users can choose which to instantiate and use. The interface is used to define a simple plugin architecture, and I felt it would be easiest if there was a programmatic way to 'search' for classes that implement this interface, versus having to manually add the class names to a properties file, etc. I.e. if they're in the classpath, they'd 'automagically' be available and listed in the UI. Minor, but thought it would be nice touch. I'm assuming then that a properties file or similar route is the only way I can go about this? Thanks, M ========================================================================== TOPIC: building an object index - data structure question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a06239c8e3bcc672 ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 9:37 pm From: [EMAIL PROTECTED] (Raj) Hi all, I have a requirement to be able to search a huge list of java objects (constructed from a database resultset) given the value of certain member variables. I could achieve the same by having n separate HashMaps, one for each variable member I want to include in the search, with the hashmap key being the member value and the hashmap value being the object itself. Is there a better data structure I can use? Any better way to do this? Would a treemap be more efficient for searching than a HashMap? If this were in the database, an index could be used. What would be the java equivalent? Thanks in advance Greetings -Raj ========================================================================== TOPIC: retroweaver - anyone had a go at fixing it for current jdk1.5.0 release? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/747320088e6854dd ========================================================================== == 1 of 1 == Date: Sat, Oct 16 2004 10:18 pm From: [EMAIL PROTECTED] (Toby Reyelts) Alex Hunsley <[EMAIL PROTECTED]> wrote in message > Sorry, perhaps I am being really silly here, but I have looked at the > site again and can't find what I should be downloading. The package I > originally downloaded yesterday was: > > 3/24/2004 - Retroweaver 1.0 RC5 Released. > > > ...is this the one that should work? The latest available version on SF is 1.0 FCS, and it has been compiled with JDK 1.5 FCS. God bless, -Toby Reyelts ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
