0

I am reading about difference between BeanFactory and ApplicationContext, but everywhere it is only mentioned that:

  • former doesn't support internationalization while later supports
  • and another is ability to publish event to beans that are registered as listener

I couldn't find explanation using code example, could someone please through light on this using a code example.


UPDATE: Please note that I know that it is better to use "ApplicationContext" but I want this for my learning purpose.

pjj
  • 2,015
  • 1
  • 17
  • 42
  • 1
    Is there something that https://stackoverflow.com/questions/243385/beanfactory-vs-applicationcontext doesn't answer? Mainly the "If you don't have a good reason not to, use `ApplicationContext`". – Kayaman Mar 26 '18 at 10:05
  • No, I don't find code examples, I need some explanation using code examples – pjj Mar 26 '18 at 10:11
  • 1
    If you read the docs linked in the top answer it says "use an ApplicationContext unless you have a really good reason for not doing so". That would be enough for me. Here's a more up to date link for spring 5. https://docs.spring.io/spring/docs/5.0.x/spring-framework-reference/core.html#beans-beanfactory – Ben Thurley Mar 26 '18 at 10:16
  • @BenThurley I know that it is better to use "ApplicationContext" but I want this for my learning purpose. – pjj Mar 26 '18 at 10:21
  • It's all explained in that link to the docs. I don't think you['ll find anything better than that. It even includes code examples like you're asking for. I would concentrate more on learning things that will be useful rather than historical features only maintained for backwards compatibility with old frameworks. – Ben Thurley Mar 26 '18 at 10:30
  • 1
    I'm closing this. Nobody's going to write code examples here. If you can't follow the code examples from the official documentation, then it's unlikely you'll be able to follow them written by us. If you have specific questions about something related to appcontext vs beanfactory, create a new question about that. – Kayaman Mar 26 '18 at 10:52

0 Answers0