Buddhika Disanayaka

Ranch Hand
+ Follow
since Jan 06, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Buddhika Disanayaka

Hi Sangel Kapoor,

Spring framework consist of many features. Based on your question, to understand what DI or IOC, please look into this code segment.




See the Human class and it contains a reference to Heart class as a private property.
If you want to set a heart object to Human , Then you have to write following code.



But what DI or dependency injection does is setting the heart object to human during run-time.
So you do not need to write code to set the heart object.
If you use spring DI feature you do not need to write above code Segment-3.
That will be done by spring dependency injection.
(Heart is a dependent of Human, So spring has injected the dependent,Heart into Human. That's that we call Dependancy injection)

Any how even without people can develop java applications.
But spring provide some easy ways of doing things, provide some features(eg: DI, IOC), provide a platform for application development and enforce best practices ect.
To learn more about Spring you can find many articles on the internet. Below is an introduction.
http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/overview.html
10 years ago
mm mm.. But what is the purpose of integrating two frameworks(Struts 2 and Spring for back end) if spring framework with spring mvc provide all the functionalities that struts 2 can provide?
10 years ago
Hi Thang,

If you use spring mvc and spring framework for back end you have spring framework’s Dao module that makes database integration easy.
That provide easy integration with hibernate, jpa or jdbc.
And another useful module that spring provides is spring security which provides a framework to handle security of the application.
Other than that spring framework comes with some features like transaction handling , mail handling ect which are not available in Struts 2.
Other than that spring provide some other things like spring web services, AOP ect.

Thanks,
Buddhika
10 years ago
According to this statement it says that Spring AOP provides an extra service to existing Spring IoC .
So Spring AOP acts as a middleware for Spring IoC.
11 years ago
Hi David,

According to your error log, It says that you have missed a jar file that contains a class called LogFactory.
So please download below jar file and add it into your eclipse build path and try again once.
http://commons.apache.org/proper/commons-logging/download_logging.cgi

Thanks,
11 years ago
Run following code and check. Hope that is the functionality you want.

12 years ago
Hint : first think about java exception catching order.
12 years ago
Hi,

I have heard the name ‘Portal framework’ in many places. But I don’t know what it is. Tell me what a portal framework is and give me some examples for portal frameworks in java.

Thanks.
13 years ago
Try to deploy a EJB in a web server. you cant to that. Read 65th page of 'Head first Servlet and JSP' book.
13 years ago
I cant agree with jishnu's answer.Normally you can assign a subtype object to its super type reference. But in java generics it’s not applicable. By putting <Number> after List reference, you are telling that reference listNumber can hold lists only with the same generic type. Write below code and try to compile. That compiles without any problem.

That's how java generics behave.Refer 7th chapter, ‘Generics and Collections’ in 'SCJP Sun Certified Programmer for Java 5 Study Guide' book witch was written by Kathey Sierra to get a better understanding about java generics.
13 years ago
Yes,
is about main thread according to your program. But the exception you are getting is not a problem of that thread.Have can you seen that main method of your program has an argument of String array ,String[] args. and you are trying to get the first element of args array by calling args[0] in 4th line of your code.Trying to retrieve an element from an empty array generates an ArrayIndexOutOfBoundsException.To avoid this error you have to provide a command line argument that can be parse to an interger (eg: 10,29).Search google for "command line arguments java" to find how you can give command line arguments to a java program.
13 years ago
I feels like you have asked a broad question that I cant give a direct answer at once.Normally proper way to develop an application is described by 'Software Development Models' like waterfall model, spiral model ect. I think you can get a very accurate answer by narrowing your question or being specific.Or if you have a problem in design,better try it posting the question in "OO, Patterns, UML and Refactoring" section of the forum.
13 years ago