Seedwork      源框架

Martin Fowler               马丁·福勒

11 September 2003      2003-9-11

In the very earliest days of Object-Orientation, the OO advocates like me put a lot of attention into arguing in favor of reuse. Early on we talked about reusing of classes. Then we discovered that reusing individual classes, while it worked in some cases, didn't work so well elsewhere. So we got into reusable frameworks, which got us part-built applications of functionality.

在面向对象的最早期,像我这样的面向对象支持者,把大量的注意力放到了讨论复用的好处上。早期我们谈到了复用的类。然而我们发现,复用一个独立的类,在某些情况下很好用,但是在某些情况下却不行。所以我们就考虑可复用的框架,它能够让我们部分构建应用程序的功能。

On the technical side, this kind of reuse has been a success - just look at the large libraries available with such environments as Java and .NET (and not just OO - as CPAN demonstrates). But particularly on the business side, such reuse hasn't been so quick to appear. And of the technical side many people feel that many of the frameworks they deal with are too complex for their purpose, and this complexity gets in the way of making these things useful.

在技术方面,这种复用已经很成功了——就像Java、.Net环境中的类库。(当然不仅仅是面向对象领域-比如CPAN(Comprehensive Perl Archive Network- Perl程序库)演示)。但是在业务方面,这种复用就没有这么快的出现。很多搞技术的人觉得从他们的使用目的来看,大多数框架对他们来说太过复杂。但是他们还是会以这种复杂的方式应用于平时的开发。

A recent weblog by Michael Feathers dug into this question, the resulting discussion came up with an alternative notion - the seedwork. A framework is supposed to be a part-baked application that you extend in controlled ways to provide what you need. A seedwork is some minimal functionality that you modify however you like to get what you need. Of course this means that there's no way for you to get common updates to the seedwork, once you grow it you own it. This is the kind of copy and paste reuse that many people, including me, deride.

最近迈克尔.菲瑟斯在他的博客中提出这个问题,讨论过程中,提出了一个替代的概念- seedwork。框架我们可以认为部分拷贝到我们的应用程序中,根据我们的需求在一些限制下进行扩展。seedwork是一些最小的功能,并且你可以根据你的需求进行任意的修改。当然,这就意味着,你不可能有一个通用的方法来修改seedwork,一旦你扩展了它,那它就只属于你的系统。这是一种被很多人鄙视的复制和粘贴的复用方式,同样我也鄙视使用这种方式。

Maybe I shouldn't be so scornful. Frameworks and libraries work very well when they are well-seasoned. But getting a good framework is very hard. Seedworks are not as useful as a good framework, but are easier to create and use. The point is not whether they are ideal, but just whether they are useful.

也许我不应该这样。一些经过长时间实际应用的框架和库,能够很好地应用于我们的开发工作。但是往往很难找到一个好的框架。Seed Works可能不像一个好的框架那么好用,但它更容易创建和使用。问题的关键不在于它是否理想,而是它是否有用。

And even mature reuse can often be a problem. We still haven't really figured out how to deal with shared libraries that upgrade on different schedules. We've all moaned at Microsoft's DLL-hell. Just this week I found my Red Hat system got wedged when I tried to install some software and found my version dependencies were all screwed up (that was half a day down the drain.) Maybe the versioning system in .NET will solve this, but so far it's far too easy for even good people to get nailed.

即使是成熟的复用也经常会出问题。我们还没有真正的搞明白,如何处理不同版本的共享库。我们过去一直在抱怨微软的DLL(Dynamic Link Library)。就在本周,我在安装软件的时候,把我的红帽子系统搞挂了,后来发现我的版本依赖一团糟(浪费了我半天时间.)。也许.NET的版本系统能够解决这个问题,但迄今为止它还是很容易让人中招。

I've found that reuse (or avoiding duplication) within an application is vital. But reuse across applications is much tougher, primarily because an Application Boundary is primarily a social construction. That's yet more evidence that reusable frameworks are much tougher than we think, and yet more reason that we should consider less perfect alternatives - such as seedworks.

我发现复用(或避免重复)在一个应用程序中是非常重要的。但跨应用程序的重用更为困难,主要是因为应用程序边界是一种社会构成。更多的证据表明,可重用的框架比我们想象的更加困难,结合其他更多的原因,我们应该考虑不完美的替代品-如Seed Works。来解决跨应用程序的复用的问题。

Seedwork的更多相关文章

  1. What Is Seedwork

    最近研究DDD,发现很多DDD的例子都有一个Seedwork的项目.从名字我没办法推断是什么作用,看代码里面是一些公共的接口跟基类.google了一会基本都是英文资料.发现两篇大作.下面是摘要: 1. ...

  2. .NET领域驱动设计—看DDD是如何运用设计模式颠覆传统架构

    阅读目录: 1.开篇介绍 2.简单了解缘由(本文的前期事宜) 3.DomainModel扩展性(运用设计模式设计模型变化点) 3.1.模型扩展性 3.2.设计模式的使用(苦心专研的设计模式.设计思想可 ...

  3. .NET 微服务和Docker容器

    .NET 微服务:适用于容器化 .NET 应用的体系结构 容器和 Docker 简介 什么是 Docker? Docker 术语 Docker 容器.映像和注册表 为 Docker 容器选择 .NET ...

  4. asp.net mvc webapi 实用的接口加密方法

    在很多项目中,因为webapi是对外开放的,这个时候,我们就要得考虑接口交换数据的安全性. 安全机制也比较多,如andriod与webapi 交换数据的时候,可以走双向证书方法,但是开发成本比较大, ...

  5. DDD实践:领域事件

    要求:修改good表,添加 organization 基础定义 用于引发和调度事件的延迟方法 AddDomainEvent Domain\SeedWork\Entity.cs public abstr ...

  6. asp.net mvc webapi 实用的接口加密方法(转载)

    在很多项目中,因为webapi是对外开放的,这个时候,我们就要得考虑接口交换数据的安全性. 安全机制也比较多,如andriod与webapi 交换数据的时候,可以走双向证书方法,但是开发成本比较大, ...

  7. net mvc webapi 实用

    asp.net mvc webapi 实用的接口加密方法   在很多项目中,因为webapi是对外开放的,这个时候,我们就要得考虑接口交换数据的安全性. 安全机制也比较多,如andriod与webap ...

  8. NLayerAppV3--DDD之领域层

    回顾:NLayerAppV3是一个使用.net 2.1实现的经典DDD的分层架构的项目. NLayerAppV3是在NLayerAppV2的基础上,使用.net core2.1进行重新构建的:它包含了 ...

  9. NLayerAppV3--.net Core2实现的DDD分层架构

    虽然每天的工作都是CURD.还是使用着传统的三层架构.使用着.net Framework,但是这并不能影响我学习DDD和.net core. 总是希望软件在应对复杂多变的场景时能够游刃有余,在解决问题 ...

随机推荐

  1. poj 1005 I Think I Need a Houseboat

    #include <iostream> using namespace std; const double pi = 3.1415926535; int main() { ;; doubl ...

  2. URAL-1991 The battle near the swamp 水题

    题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1991 水题.. //STATUS:C++_AC_15MS_333KB #include ...

  3. cc.Sprite

    Classcc.Sprite Defined in: CCSprite.js Extends cc.NodeRGBA Class Summary Constructor Attributes Cons ...

  4. IdTCPServer

    IdTCPServer1 Server本身就支持多线程,一个服务端连接多个客户端. IdTCPServer1.Bindings.Add.IP := '127.0.0.1';IdTCPServer1.B ...

  5. 如何判断Android设备是手机还是平板?

    转自:http://blog.csdn.net/zuolongsnail/article/details/8682950 Android开发需要适配手机和平板,有些需求在实现中就要判断设备是手机还是平 ...

  6. Cisco Router WEB管理

    目前市场上很多思科路由器或者交换机都可以通过WEB方式配置.尽管很多功能还是只能通过CLI配置,但是一些功能还是很有用的,例如端口的流量监控功能 前期准备: 一.设备的IOS要支持WEB管理功能   ...

  7. C# Control 控件DrapDrop不触发的问题

    今天在做一个鼠标拖拽功能时,需要用到PictureBox的拖拽,即拖拽一个图标到PictureBox上实现加载绘制,可是怎么整也触发不了DrapDrop事件,最后终于找到了解决方法:原来需要在Drog ...

  8. win8下hosts保存文档失败,提示:请检查文件是否被另一个应用程序打开

    选择文件,然后右键点击属性,然后进入"安全"选项卡下点击当前用户对用的用户名然后编辑权限,给予完全控制的权限. 如图: 图一:

  9. Xcode快捷键整理

    下面是Xcode比较常用的快捷键,特别是红色标注的,很常用.用熟了开发编辑代码的的时候就很方便,希望对大家有用~1. 文件CMD + N: 新文件CMD + SHIFT + N: 新项目CMD + O ...

  10. Linux下getopt()函数的简单使用

    最近在弄Linux C编程,本科的时候没好好学啊,希望学弟学妹们引以为鉴. 好了,虽然啰嗦了点,但确实是忠告.步入正题: 我们的主角----getopt()函数. 英雄不问出处,getopt()函数的 ...