Alex Rivera | Logout

Does having many unused beans in a Spring Bean Context waste significant resources?

Asked 2008-09-19T00:25:25.987
9

My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it.

My question is: Since not all beans are used in all projects am I wasting resources to any significant amount if there not being instantiated? I'm not too sure how lazy Spring is about loading them since it's never been an issue until now.

Any ideas?

Edit
Report

1 Answer

0

By default Spring beans are singletons and are instantiated when the application context is created (at startup). So assuming you haven't overridden the default behaviour, then a single instance of every bean will be created.

answered 2008-09-19T00:51:39.933

Your Answer