Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Where can I find a very simple example of IOC to get started?

  1. #1
    Join Date
    Dec 2006
    Posts
    26

    Default Where can I find a very simple example of IOC to get started?

    Does anyone have a very simple example (no more than 2 or 3 .java files)
    on how to use Spring 2.5 with annotation based configuration?

    I can not find a very simple example anywhere that only has the following:
    => Proper Spring 2.5 init & Setup
    => POJO A that is injected into POJO B
    => POJO B that has POJO A injected (annotation example)

    * I am not using a database, so no dao layer
    * I am not building a web application so do not have a WEB-INF/
    * There are no controller or service objects
    (just a static main in one class that depends on another class)

    What I am looking for is the simplest example to get started.
    All code out there I see are code snippets and not fully compilable examples and assume that the Spring setup/init has already been done.

    I looked through the 2.5 manual, but most all the
    code snippets use xml based configuration and are not annotation based.
    There is no fully compilable example of what I am looking for in the manual that shows Spring setup from beginning to end that I can paste into an IDE and get started.

    ---
    All the code snippets on the web are not fully compilable examples
    and use a database layer or have a lot of web based code there
    (WEB-INF/ configuration files.

    What I am seeking is a zip file with the simplest example so I can
    see how this works first. I am looking for a minimal example to
    get started on IOC.

    If there is a minimal example out on the web (no dao's, no web app, no xml config), please send me a link and that will get things rolling.

    thanks


    jgr

  2. #2
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

    Default

    I recommend you to look through the reference then. 3. The IoC container chapter answers all of your questions.

  3. #3
    Join Date
    Dec 2006
    Posts
    26

    Default These kind of answers are completyl annoying and useless

    Listen, if you read the article there was a section where I said that I had already read the fucking manual, and did not find what I was looking for.

    Here it is again (please take time to read a post if you are going to respond, and please do not respond at all if you have no useful information.) Please use your time doing something actually useful instead of annoy people.

    I said quote => "I looked through the 2.5 manual (the IOC part), but most all the code snippets use xml based configuration and are not annotation based."

    Translation: There is no fully compilable example of what I am looking for in the manual that shows Spring setup from beginning to end that I can paste into an IDE and get started.

    => In short the manual does not have what I am looking for. What I am looking for is compilable code that I can use to get started. I have many, many questions and could get a working example (requested) or I could ask a dozen example here.

    It should not take two days to get started with IOC but it is turning into this (read manual then fumble around because there is no end to end example of annotation based IOC and then post asking for help and then dealing with annoying responses).

    If you choose not to answer the question or provide help, then do not respond to posts at all.

  4. #4
    Join Date
    May 2007
    Location
    Saint Petersburg, Russian Federation
    Posts
    1,189

    Default

    Good luck, mr. politeness

  5. #5
    Join Date
    Dec 2006
    Posts
    26

    Default sorry I lost it

    really sorry I lost it, but it was frustrating that I could not find the information I wanted in the manual - I actually printed it, had it bound and read the whole thing end to end, especially the entire Chapter 3 and wrote down 86 questions I had from that chapter.

    I also googled for examples, read dozens of articles and could not find a very simple end to end example of what I was looking for. Only code snippets were provided but I needed and end-to-end example.

    I was simply trying to save time by asking for a working example rather than post 86 questions.

  6. #6
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    314

    Default

    Hold your horses...

    Just download the Spring distribution from spring source download section (sourceforge) and see the examples provided with the distro. Don't remember anymore how many examples there are, but they are easy enough to start from.
    if a trainstation is where the train stops, what's a workstation...

  7. #7
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    Mr "gooroo" perhaps you ought to read something like this before you post here (or anywhere else for that matter) anymore:

    http://www.catb.org/~esr/faqs/smart-questions.html

    I expect you'll get the help you deserve after the tenor of your first few posts....karma is a bitch.

  8. #8
    Join Date
    Dec 2006
    Posts
    26

    Default not so fast

    The deal is that most questions posted in any open source community are answered by some yahoo that simply puts a link to the documentation and it shows up in their stats as having answered a question.

    I think people come here looking for help and are smart enough to know where to find the documentation and see if they can find an answer themselves before posting.

    Can you imagine calling Microsoft support, or Oracle support and having them not answer your question at all but tell you to look on page 23 after you already told them that you read page 23?

    Fellow programmers come to this forum for help and the typical responses I see here are not really helpful. I often read a very interesting question posted by others and after reading it do not have any more information after reading the answers than when I started.

    The quality of help in open source communities is extremely poor. I should not complain, you do get what you pay for. And simply put since I am not paying for anything, I should not expect to get anything.

    As such we have decided to go with a commercial option instead.

  9. #9
    Join Date
    Jan 2008
    Location
    San Diego
    Posts
    780

    Default

    Quote Originally Posted by jgooroo View Post
    The deal is that most questions posted in any open source community are answered by some yahoo that simply puts a link to the documentation and it shows up in their stats as having answered a question.
    Frankly, I could care less about my 'stats'. I come here to help people who I think I can help. But I expect people to participate in their own solution. Remember, I don't get paid to be here. I have a daytime job (where I use Spring) and I'm posting answers, if I have them, for others on this forum out of the goodness of my heart and on MY own time. Next time you bitch and moan about how little help you get on forums like this you might do well to remind yourself that we are volunteers.

    Spring now has paid support that you are more than welcome to purchase.

    Quote Originally Posted by jgooroo View Post
    I think people come here looking for help and are smart enough to know where to find the documentation and see if they can find an answer themselves before posting.
    You haven't been here very long, have you? The fact of the matter is that MANY posters post vague questions that show that:

    1) They haven't put much effort into their attempt to get help (they can't even be bothered to compose a lucid and complete question).
    2) They haven't put much effort into solving the problem on their own (urgent!!!! Help me!! need to use spring!!! What do I do?!!!)
    3) They've read very little, if any, of the documentation that is abundant on this site.

    Quote Originally Posted by jgooroo View Post
    Can you imagine calling Microsoft support, or Oracle support and having them not answer your question at all but tell you to look on page 23 after you already told them that you read page 23?
    Have you ever called Microsoft? I've gotten exactly this kind of run around from companies like BEA and Microsoft and we were paying ALOT of money for annual support. In the end, I often found that after I went around the block with several tiers of paid support that I ended up with no solution or solving the problem myself, no thanks to the support engineers.

    Quote Originally Posted by jgooroo View Post
    The quality of help in open source communities is extremely poor. I should not complain, you do get what you pay for. And simply put since I am not paying for anything, I should not expect to get anything.
    Actually, I find the support for most open source products much better than the closed source alternatives.

    Quote Originally Posted by jgooroo View Post
    As such we have decided to go with a commercial option instead.
    Good luck.....

  10. #10
    Join Date
    Dec 2006
    Posts
    26

    Default Last word

    The bottom line is that I posted asking for an example to get started. Before I posted I spent 2-3 hours reading documentation, trying different things, failing and then googling for sample code and found none. Maybe I looked in the wrong places. Maybe it should not be so hard to find? The documentation was a bit convoluted. I do understand that you get what you pay for and that the documentation purpose is so that you pay for support which I do believe is the very best route anyone can take with the simplest of tools.

    ---
    The bottom line is that I came to the forum asking for help and my request was very simple - sample code that works. The bottom line is that everything but this was offered from the community, instead a lot of unnecessary chatter was the response.

    I simply do not have the time on my hands for things like this that types like you may have.

    If I take the time to answer someones question, I attempt to offer some value instead of replies with little substance in relation to what was requested or sought.


    you get the last word.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •