Does the "Android Activity Life Cycle" use a template template?

I believe that the Template template includes encapsulating each step in an algorithm.

I think activity life cycles (onCreate, onResume, etc.) are steps that need to be overridden by a particular class.

Does this mean that the Android activity life cycle (activity and fragment classes) matches the template template template, or is there another template that suits it better

thanks

+5
source share
1 answer

The construction of the Android platform definitely matches the template of the template, which is its strength, but also its weakness. Since this template offers to implement only part of the module, getting a quick and simple result is easy, without attracting too much effort.

However, since it is based on inheritance, it can become really unpleasant after you start thinking about expanding the framework or dealing with a cross-problem pattern. Most Android frameworks require an Activity extension to use, and since multi-inheritance is not an option, this limits the way you create your functions.

An approach that promotes composition over inheritance would be more than welcome, and the only reason I can imagine why this choice was made is performance issues.

+1
source

Source: https://habr.com/ru/post/1202636/


All Articles