Need To Clarify chapter01 example

28 views
Skip to first unread message

PANKAJ DUBEY

unread,
Aug 24, 2016, 5:05:08 AM8/24/16
to Getting started with Spring Framework

Hello,

why we aren't injecting FixedDepositDetails in FixedDepositController.
I am really first time looking into spring so please let me know what point missing here.

public boolean submit() {
return fixedDepositService.createFixedDeposit(new FixedDepositDetails(
1, 10000, 365, "some...@something.com"));
}

Thanks
-Pankaj

Ashish Sarin

unread,
Aug 24, 2016, 6:45:29 AM8/24/16
to PANKAJ DUBEY, Getting started with Spring Framework

Hi Pankaj,

FixedDepositDetails is a domain object; therefore, it is not be injected into the FixedDepositController. You will see special mention in the book that domain objects are either created using the new keyword or by the ORM framework used in your application.

Regards
Ashish


--
You received this message because you are subscribed to the Google Groups "Getting started with Spring Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getting-started-with-spring-framework+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages