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?

Friday, September 17, 2021

Best Practices & Principles in OOP

SOLID principles

Before even beginning to introduce all the essential OOP principles and patterns, keep in mind that:

  • Focus only on KISS ("Keep it simple and stupid") and OOP Principles first, then observe your code to see which pattern it might need for a code quality improvement -> apply patterns  

1. Single Responsibility 

"A class should have one, and only one, reason to change."

Wednesday, September 15, 2021

HOW GOOD IS GODD ENOUGH? By H.P. Schoener (On quantitative evaluation of functionalities in self-driving vehicles)

最近在寫論文的前言與動機的部分,看了一篇有趣的文章。這邊簡單做個重點紀錄供日後閱讀。

1. “How Good is Good Enough?“ in Autonomous Driving? by H.P. Schoener
本文提出一個量化自駕車功能"是否夠好"的方法。

自動駕駛就是把人類開車時95%會做對的事情自動化,把剩下5%最小化。據統計,德國高速公路(Autobahn)平均每行駛750萬公里會有一次S0等級(S0是最輕微的)事故,也就是說自駕車測試至少要跑750萬公里且不能發生任何事故。
五大常見的意外起因:

德國汽車產業近年的困境

註:本文於2020年九月完成,時隔一年才發布,但是疫情還沒結束,所以內容都適用啦~

最近因為corona疫情影響,德國汽車產業備受打擊,政府出手Kaufprämie(消費津貼)救車市,否則會有更多人失業...到底為什麼德國舉世聞名的汽車產業會面臨這窘境呢? 除了疫情影響,其實原本產業就不太好? 本文會簡單介紹一下我的看法。