Message from discussion
Eclipse 4 RCP - Tutorial -Dependency Injection
Received: by 10.224.180.141 with SMTP id bu13mr2518815qab.2.1351943983784;
Sat, 03 Nov 2012 04:59:43 -0700 (PDT)
X-BeenThere: vogella@googlegroups.com
Received: by 10.229.197.162 with SMTP id ek34ls7251565qcb.1.gmail; Sat, 03 Nov
2012 04:59:42 -0700 (PDT)
Received: by 10.224.180.141 with SMTP id bu13mr2518800qab.2.1351943982383;
Sat, 03 Nov 2012 04:59:42 -0700 (PDT)
Received: by 10.224.2.134 with SMTP id 6msqaj;
Tue, 23 Oct 2012 04:17:01 -0700 (PDT)
Received: by 10.52.91.109 with SMTP id cd13mr1913090vdb.15.1350991021119;
Tue, 23 Oct 2012 04:17:01 -0700 (PDT)
Date: Tue, 23 Oct 2012 04:17:00 -0700 (PDT)
From: utiDev <uti.de...@googlemail.com>
To: vogella@googlegroups.com
Message-Id: <7087e5f9-5b14-4e9d-8097-bee4b09ba06b@googlegroups.com>
Subject: Eclipse 4 RCP - Tutorial -Dependency Injection
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_1591_918653.1350991020690"
------=_Part_1591_918653.1350991020690
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Hi,
i got stuck in the Eclipse 4 RCP - Tutorial at:
14. Dependency Injection and Annotations
14.1. What is Dependency Injection?
There is a nice example how to inject a Logger or something else.
// @Inject private Logger logger;
// // DatabaseAccessClass would talk to the DB
// @Inject private DatabaseAccessClass dao;
The one thing i don't get is where to register my classes i want to inject. Just creating a class and add the @Inject statement to another class seems not to be enough.
How to register my class so the applicationcontext is able to inject it?
I created a sample application. I created a class A with a function sayHello() :). What to do to be able to inject it to one of my handlers?
Thanks in advance :)
------=_Part_1591_918653.1350991020690--