Showing posts with label Spring Framework. Show all posts
Showing posts with label Spring Framework. Show all posts

Sunday, December 5, 2021

Spring Professional Certificate Study Guide Section 1-1, Question 16-28

16. What does the @Bean annotation do?

17. What is the default bean id if you only use @Bean? How can you override this?

18. Why are you not allowed to annotate a final class with @Configuration

19. How do you configure profiles? What are possible use cases where they might be useful?

20. Can you use @Bean together with @Profile?

21. Can you use @Component together with @Profile?

22. How many profiles can you have?

23. How do you inject scalar/literal values into Spring beans?

24. What is Spring Expression Language (SpEL for short)?

25. What is the Environment abstraction in Spring?

26. Where can properties in the environment come from – there are many sources for properties – check the documentation if not sure. Spring Boot adds even more.

27. What can you reference using SpEL?

28. What is the difference between $ and # in @Value expressions?

Tuesday, November 30, 2021

Spring Professional Certificate Study Guide Section 1-1, Question 1-15

1.1 Container, Dependency and IOC

In this article, I'm going to answer the first 15 questions of Section 1.1 from the Professinal VMware Spring Certificate study guide. Those questions are:
  1. What is dependency injection and what are the advantages of using it? 
  2. What is an interface and what are the advantages of making use of them in Java? 
  3. What is an ApplicationContext?
  4. How are you going to create a new instance of an ApplicationContext?
  5. Can you describe the lifecycle of a Spring Bean in an ApplicationContext?
  6. How are you going to create an ApplicationContext in an integration test?
  7. What is the preferred way to close an application context? Does Spring Boot do this for you?
  8. Are beans lazily or eagerly instantiated by default? How do you alter this behavior?
  9. What is a property source? How would you use @PropertySource?
  10. What is a BeanFactoryPostProcessor and what is it used for? When is it invoked?