Results 1 to 2 of 2

Thread: Best practice for Bean declaration

  1. #1

    Default Best practice for Bean declaration

    Hi,

    What is the best practice for bean declaration i.e., should all classes be declared as bean or any specific set of classes. Declaring all classes as bean will clutter the application context.

    Any suggestion will be greatly appreciated.

    Thanks a lot.

    Best Regards,

    ssroy

  2. #2
    Join Date
    Jun 2010
    Posts
    5

    Default

    In spring, DI & IoC can say more about "WHY TO DECLARE A CLASS AS A BEAN?".

    Just consider that, declaring any class as a bean means that class is given to the spring to handle its object creations and handling.

    I would prefer to declare all classes as a bean if 'The Spring' is your primary playground of development.

    In case if a class is static or its intended to provide static functionality, then it can be avoided to be declared as a bean.

Posting Permissions

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