Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Best Way to Pass Info Between Objects? Date: Sun, 08 Jan 2012 10:45:07 -0800 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <4dWdnRF6pOQcUJTSnZ2dnUVZ_vidnZ2d@earthlink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 8 Jan 2012 18:45:10 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="31680"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX195KS7VetkzfL21BR5WU4JuxPMdVhLlRv0=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: Cancel-Lock: sha1:vn6iUH34spKRKVBsjXmElSLdnpQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11113 On 1/8/2012 10:22 AM, Novice wrote: > But in the meantime, are there any general rules I can use to make these > decisions for code I am developing now? Or do I really need to master > several books first? Loose Coupling is one such general rule. This is basically what Patricia is advocating, as classes that are loosely coupled tend also to be easier to unit test. For example, you seem to have a lot of different (and fairly complex) classes running around your code right now. One way to simplify unit testing is to use mock objects. There's some good links in both of those articles to get you started.