What are collaborators in java?

hey, i was reading an article about dependency injection and it says:
"Dependency Injection has several important benefits: For example
-Because components don't need to look up collaborators at runtime, they're much simpler to write and maintain.....
- A good IoC implementation preserves strong typing, If you need to use a generic factory to look up collaborators, you have to cast the results to the desired type....
Could someone please explain what collaborators are, or give me some good references to read regarding them? Haven't really found any good explanation through google.
Thanks

So does that mean, in this example, the collaborators of the object Rocket are the Engine object eng and the Fuel object fuel?
public class rocket {
     private Engine eng;
     private Fuel fuel;
public rocket(Engine eng, Fuel fuel) {
     this.eng = eng;
     this.fuel = fuel;
}

Similar Messages

  • What are differences between Java and C#

    What are differences between Java and C#?
    I was looking at C# and it looks very similar to java, does anyone have any input on what the primary differences are?

    C# has ventricles, being a more modern, hip,and
    stylin language.Yeah, but it can't use them properly unless youbolt
    on an after-market turbo charger and paint some
    go-faster stripes.
    Java doesn't need ventricles, as the language is
    built as a bifurcative scrobbidibbit from theground
    up.
    And here I thought you were smart.The ventricles add power on the backswing and keep
    down the humpty-B count, and those stripes don't
    really do much except to impress the PHBs. A
    ventricle here and there wouldn't do Java anyharm.
    Oh, I see.
    I didn't realize you were concerned with humpty-B. So
    I suppose you put 17 firewalls in front of your VM's
    Jeffries tubes too huh? And measure productivity in
    fleems per wonkle?
    That may have worked back when you carved FORTRAN on
    stone tablets, and then went to look for a nice young
    lady to club and take home. But modern software
    development techniques demand a focus on the
    regressive thromboid paradigm, and ventricles only
    get in the way when you're trying to calibrate that
    against the latest fractal suppository data.At least I have actual experience in carving FORTRAN on stone tablets, so I know what I'm talking about. (The clubbing was the other way around but that's neither here nor there.) As for your regressive thromboid paradigm, regressive is exactly what it is. Progressive paradigms, whether thromboid or rhomboid, require ventriculation to achieve their maximum potential.
    And I suppose if you're still using those Jeffries tubes in your VM, it's not surprising that it's humptied to the max. Try installing Apache Fallopian if you really want to dehumptify it, or Apache Eustachian for 64-bit VMs.

  • What are vectors in java ?

    Dear forum users ,
    I would like to know if there be any resources available or any information available on what are vectors and how do they function in java . thank you .

    Dear forum users thanks again for your replies ,
    basically im trying to understand this below code which im not really sure whether its a vector or a for loop and if its neither what does it mean ,could anyone explain the part i have indicated below in bold especially the part on the for(int i=msgs.size()-1; i>=msgs.size()-maxText,i--) and the msg=(Message)msgs.elementAt( i ) ; and why the need for a declaration of a integer j,p=-1
    int maxText = 11; //max texts displayed
    if (history || msgs.size() < maxText)
    maxText = msgs.size();//all texts
    history = false; //reset
    int lin = 0; //links count
    *for (int i=msgs.size()-1; i>=msgs.size()-maxText; i- -) {*
    msg = (Message) msgs.elementAt( i );
    int j,p = -1;

  • What are my options (Java)?

    Hi all,
    I have a macbook (2009) running on OS v 10.5.8. I've read that there are no more Java updates made for this version. I need it for school. Some of the lessons I need aren't opening properly. What are my options at this point? Can I even get Java on my macbook anymore?
    Thanks
    Nichole

    There is no further update to Java for Leopard than this one:
    Update 10, 29 June 2011 - This release updates J2SE 5.0 to 1.5.0_30, and updates Java SE 6 to 1.6.0_26. J2SE 1.4.2 is no longer being updated to fix bugs or security issues and remains disabled by default in this update. Support for out-of-process Java applets on Mac OS X 10.5 Leopard has been removed with this update.
    This release is only for Mac OS X 10.5.8 or later versions of Mac OS X 10.5. http://support.apple.com/kb/DL1359

  • What are the pros and cons of installing java+abap stack for portal?

    Hi all,
      1.What are the pros and cons of installing java+abap stack for portal?
      2.what effect it does on the ume options to be choosen??
      3.for the purpose of integration of r3,bw and crm on portal and crm 4.0 60.2.3 business package which option of stack(java or abap or both)will be good option and which ume option while installation should be choosen?
    regards
    Rajendra

    Hi Rajendra,
    The NetWeaver Installation Master Guide offers some good scenarios on the pros and cons:
    https://websmp201.sapag.de/~sapidb/011000358700005412792005E.pdf
    In a nutshell:
    ABAP+JAVA
    Pros
    - Decrease # of servers required to administer the portal
    - Less costly
    Cons
    - Upgrades could be dependent on ABAP and Java release level
    - Additional load on the server due to ABAP stack
    - Limited scalability
    JAVA and ABAP on separate server
    Pros
    - Improved performance
    - Allows each system to be single-use purpose therefore downtime does not affect other components
    - More scalable
    Cons
    - Adds complexity to landscape
    - Additional costs
    Regards,
    Thomas Pham

  • What are the java components?

    hi iam new to this it field. this is the question asked by interviewer. so please help me.
    what are the java components you can use in a webproject? how you use those components in your project?

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

  • What are the main things to do when optimizing the performance of Java App

    what are the main things to do when optimizing the performance of Java App

    what are the main things to do when optimizing the performance of Java App

  • What are Best Practice Recommendations for Java EE 7 Property File Configuration?

    Where does application configuration belong in modern Java EE applications? What best practice(s) recommendations do people have?
    By application configuration, I mean settings like connectivity settings to services on other boxes, including external ones (e.g. Twitter and our internal Cassandra servers...for things such as hostnames, credentials, retry attempts) as well as those relating business logic (things that one might be tempted to store as constants in classes, e.g. days for something to expire, etc).
    Assumptions:
    We are deploying to a Java EE 7 server (Wildfly 8.1) using a single EAR file, which contains multiple wars and one ejb-jar.
    We will be deploying to a variety of environments: Unit testing, local dev installs, cloud based infrastructure for UAT, Stress testing and Production environments. **Many of  our properties will vary with each of these environments.**
    We are not opposed to coupling property configuration to a DI framework if that is the best practice people recommend.
    All of this is for new development, so we don't have to comply with legacy requirements or restrictions. We're very focused on the current, modern best practices.
    Does configuration belong inside or outside of an EAR?
    If outside of an EAR, where and how best to reliably access them?
    If inside of an EAR we can store it anywhere in the classpath to ease access during execution. But we'd have to re-assemble (and maybe re-build) with each configuration change. And since we'll have multiple environments, we'd need a means to differentiate the files within the EAR. I see two options here:
    Utilize expected file names (e.g. cassandra.properties) and then build multiple environment specific EARs (eg. appxyz-PROD.ear).
    Build one EAR (eg. appxyz.ear) and put all of our various environment configuration files inside it, appending an environment variable to each config file name (eg cassandra-PROD.properties). And of course adding an environment variable (to the vm or otherwise), so that the code will know which file to pickup.
    What are the best practices people can recommend for solving this common challenge?
    Thanks.

    HI Bob,
    As sometimes when you create a model using a local wsdl file then instead of refering to URL mentioned in wsdl file it refers to say, "C:\temp" folder from where you picked up that file. you can check target address of logical port. Due to this when you deploy application on server it try to search it in "c:\temp" path instead of it path specified at soap:address location in wsdl file.
    Best way is  re-import your Adaptive Web Services model using the URL specified in wsdl file as soap:address location.
    like http://<IP>:<PORT>/XISOAPAdapter/MessageServlet?channel<xirequest>
    or you can ask you XI developer to give url for webservice and username password of server

  • What are the benefits of single JAVA stack?

    Dear all,
    what are the benefits of a single stack SAP BI/BW (JAVA) - which functionality is inside a JAVA Single Stack that is not in a Double Stack inside?

    I think that the ram advantages of 64 bit computers is just a minor issue with most existing Mac computers. The average user today has between 2 to 8 GB's of ram. This amount of ram is easily handled by existing OS's like Leopard.
    I believe that the actual benefits for most users will be when the code of their applications is re-written to run in 64 bit code.
    From Apples Page on New Technologies: "It can also enable computers to crunch twice the data per clock cycle, which can dramatically speed up numeric calculations and other tasks." And on the same page: "64-bit applications can use more advanced security techniques to fend off malicious code".
    http://www.apple.com/macosx/technology/
    The 'twice the data per clock cycle' will affect all users regardless of how much ram they have or plan to buy for their machines. More data per cycle means more speed. Better security built into the OS is always a plus.
    This is why a MBP with a 3GB limit will still want to run a 64 bit application, and my new iMac with an 8GB limit will still benefit from Snow Leopard.
    I view all this extra memory abilities as something very far off for Mac users today. Ram prices will have to go down even lower, new machines will have to be bought with new ram management chips, etc.
    Meanwhile, most of Apple's applications are currently running in 64 bit even if the Kernal is running at 32 bit, and other companies (like Adobe) should be coming out with 64 bit versions of their applications. Most experts agree that since the Kernal runs very low-level functions, it won't benefit from 64-bit operation near as much as user applications.
    The big delays here, are for hardware drivers to work in 64 bit, and also for helper applications like Flash. Apple knew this going into the SL project. It's going to take a year or so until almost all of our programs are upgraded. Meanwhile, both 32 bit and 64 bit programs will run on Snow Leopard.
    Message was edited by: dechamp

  • What are the BEST Books and Best websites for java biginners?

    Dear All,
    What are the BEST Books and Best websites for java biginners-Especially for fast learning.
    Thnaks
    KMK

    This is my standard reply:
    [Sun's basic Java tutorial|http://java.sun.com/docs/books/tutorial/]
    [Sun's New To Java Center|http://java.sun.com/learning/new2java/index.html]
    Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    jGuru
    A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch
    To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    [Yawmarks List|http://forums.devshed.com/java-help-9/resources-for-learning-java-249225.html]
    [The Java Developers Almanac|http://www.amazon.com/exec/obidos/tg/detail/-/0201752808?v=glance]
    [http://javaalmanac.com|http://javaalmanac.com]
    Bruce Eckel's [Thinking in Java(Available online.)|http://mindview.net/Books/DownloadSites]
    Joshua Bloch's [Effective Java|http://www.amazon.co.uk/exec/obidos/Author=Bloch,%20Josh]
    Bert Bates and Kathy Sierra's [Head First Java|http://www.amazon.com/exec/obidos/tg/detail/-/0596004656?v=glance ]
    James Gosling's [The Java Programming Language|http://www.bookpool.com/sm/0321349806]
    Gosling is the creator of Java. It doesn't get much more authoritative than this.
    Joshua Bloch and Neal Gafter [Java Puzzlers.|http://www.javapuzzlers.com/]

  • What are the security implications of having JAVA running on my Mac Book Pro?

    What are the security implications of having JAVA running on my Mac Book Pro?

    Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was always a bad idea, and Java's developers have proven themselves incapable of implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style virus affecting OS X. Merely loading a page with malicious Java content could be harmful.
    Fortunately, client-side Java on the Web is obsolete and mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice. Forget about playing games or other non-essential uses of Java.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it — not JavaScript — in your browsers.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a task on a specific site, enable Java only for that site in Safari. Never enable Java for a public website that carries third-party advertising. Use it only on well-known, login-protected, secure websites without ads. In Safari 6 or later, you'll see a lock icon in the address bar with the abbreviation "https" when visiting a secure site.

  • 4.6C to ERP6.0 Upgrade - what are the recommendations for Unicode and Java

    Hi All,
    Forgive such a basic question.
    We are just beginning to look at our ERP6.0 upgrade and am unclear whether we should convert to unicode at the same time, and also what are the uses for the Java stack.
    Unicode?
    We are a single language Latin-1 site so don't need Unicode. However will it become mandatory eventually? Are we better, if we have the opportunity now, just to convert. Also I believe the Java stack is only Unicode. Does ASCII ABAP and Java Unicode complicate things?
    Java?
    Will we need it? We are proposing a technical upgrade from our 4.6c Javaless environment. Where does Java come in to play in ERP6.0? Doesn't it increase greatly the iSeries HW requirements? (I'm looking at a 2 way 550 at the moment)
    Look forward to hearing your views.
    Regards
    Steve

    Hi Stephen,
    at the moment, in a latin-1 environment Unicode is for old customers not a requrirement. This might change in 5-10 years ...
    Java: No problem at all with ASCII (in latin-1 environments)
    => there is no need for you, but you could go for it. We did several Unicode conversions already and these Latin-1 conversions are pretty easy and simple especially on iSeries, because of the special InPlace Unicode Conversion.
    ... but this can be done at any time ...
    Regards
    Volker Gueldenpfennig, consolut.gmbh
    http://www.consolut.de - http://www.4soi.de - http://www.easymarketplace.de

  • What are the simple to use COM library in your java code

    Hi,
    what are the simple to use COM library in your java code

    PhHein wrote:
    [javax/comm|http://java.sun.com/products/javacomm/reference/api/javax/comm/package-summary.html]
    No, he wants to use Windows COM objects!
    @OP
    It's not easy. You can try j-integra or ezjcom, which I tried years ago and was not too happy, but maybe
    they improved or they are just fine for your needs. $$$ involved!
    If you want to do it by yourself, it won't be easy at all, I promise, but it can be done with JNI or JNA.
    If your interactions are very few and simple, maybe some workarounds could be found.

  • What are the names ( or a link to them) of Java files I should have? Thanx in advance.

    What are the names (or a link to them) of Java files I should have installed? Thanx in advance.

    This doesn't make sense.  It's more complicated than that.
    OS X will offer to install Java if you need it, unless you've gone in and deleted stuff and made a mess of things.  Did you manually go deleting stuff?

  • What are the PDA or phone that supporte java ????

    what are the PDA or phone that supporte java ????
    I want to integrate a java application, but tryed to integred on the Mondo Trium with Pjava, so it's too slow, is there any phone or PDA than supported my application
    My application download some maps from server and put up on panel, so it required a good machine ?????
    Please Help !!!!!

    You could try Personal JAVA with WinCE 2.11
    http://java.sun.com/products/personaljava/

Maybe you are looking for