Smalltalk和IoC [英] Smalltalk and IoC

查看:89
本文介绍了Smalltalk和IoC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了很多用于.Net和Java的IoC框架.有谁知道为什么没有等效的Smalltalk框架.这比任何其他问题都更是一个哲学问题.我想知道,在Smalltalk的做事方式中是否有某些东西排除了拥有IoC框架的必要性.

I see a lot of IoC frameworks for .Net and Java. Does anyone know why there are no equivalent frameworks for Smalltalk. This is more a philosophy question than anything else. I'm wondering if there is something in the Smalltalk way of doing things that precludes the necessity of having an IoC framework.

推荐答案

MVC 发明了在Smalltalk上使用,并且可以说是原始的控制反转框架.尽管它比Java同类产品轻一些,但它具有保存数据的模型的基本概念,即一种视图,它根据控制器发出的事件来呈现数据.

MVC was invented on Smalltalk and is arguably the original Inversion of Control framework. While somewhat more lightweight than its java counterparts, it has the basic concepts of a model holding the data, a view rendering the data in response to events propogated from a controller.

不那么轻松,实际上Java是需要一个框架支持来做一个Web应用程序,而没有过多的样板代码. Smalltalk支持编程习惯用法,例如 continuations ,这使作者可以假装他们不是真正的写事件.驱动代码. 海边就是这样,通过稍微灵活一些的开发范例为IoC带来了好处

Less flippantly, Java is actually needs a lot of framework support to do a web application without excessive quantities of boilerplate code. Smalltalk supports programming idioms such as continuations, which allow an author to pretend they are not really writing event driven code. Seaside works like this, giving the benefits of IoC with a somewhat more flexible development paradigm.

MVC是Smalltalk中UI的框架(可以说它并不是真正的框架,但类库已内置了对它的支持).它具有控制属性的倒置,因为视图和模型对控制器调度的事件做出响应-不要叫我们,我们称您为属性.控制反转是框架内的一种设计模式,用于减少Java应用程序中大量模板的需求.在应用程序框架的某些定义中,控制反转是被视为将框架与库区分开的主要属性.

MVC is a framework for UI's in Smalltalk (arguably it's not really a framework as such, but the class library has built in support for it). It has the inversion of control property in that the view and model respond to events dispatched by the controller - the don't call us, we'll call you property. Inversion of Control is a design pattern within frameworks that's used to reduce the need for extensive boilerplate in java applications. In some definitions of an application framework, Inversion of Control is the main property that is viewed as distinguishing a framework from a library.

这篇关于Smalltalk和IoC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆