One important characteristic of a framework is that the methods defined by the user to tailor the framework will often be called from within the framework itself, rather than from the user‘s application code. The framework often plays the role of the main program in coordinating and sequencing application activity. This inversion of control gives frameworks the power to serve as extensible skeletons. The methods supplied by the user tailor the generic algorithms defined in the framework for a particular application.
--Ralph Johnson and Brian Foote
--Ralph Johnson and Brian Foote
框架的一个重要特性就是框架会去调用符合这个框架的方法,而不是用户自己的程序,框架通常在主程序中扮演的是定位和引导程序的活动的角色,倒转控制给了框架充当扩展骨架的能力。用户可以根据特定的应用程序来裁剪框架中的通用算法。
本文探讨了软件框架的重要特性之一:控制倒转。通过解释框架如何调用用户定义的方法,而非传统应用程序中的用户代码调用框架的方式,文章强调了框架作为应用活动协调者的作用。此外,还介绍了用户如何通过提供特定方法来定制通用算法以适应特定应用场景。
1097

被折叠的 条评论
为什么被折叠?



