Seedwork
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的更多相关文章
- What Is Seedwork
最近研究DDD,发现很多DDD的例子都有一个Seedwork的项目.从名字我没办法推断是什么作用,看代码里面是一些公共的接口跟基类.google了一会基本都是英文资料.发现两篇大作.下面是摘要: 1. ...
- .NET领域驱动设计—看DDD是如何运用设计模式颠覆传统架构
阅读目录: 1.开篇介绍 2.简单了解缘由(本文的前期事宜) 3.DomainModel扩展性(运用设计模式设计模型变化点) 3.1.模型扩展性 3.2.设计模式的使用(苦心专研的设计模式.设计思想可 ...
- .NET 微服务和Docker容器
.NET 微服务:适用于容器化 .NET 应用的体系结构 容器和 Docker 简介 什么是 Docker? Docker 术语 Docker 容器.映像和注册表 为 Docker 容器选择 .NET ...
- asp.net mvc webapi 实用的接口加密方法
在很多项目中,因为webapi是对外开放的,这个时候,我们就要得考虑接口交换数据的安全性. 安全机制也比较多,如andriod与webapi 交换数据的时候,可以走双向证书方法,但是开发成本比较大, ...
- DDD实践:领域事件
要求:修改good表,添加 organization 基础定义 用于引发和调度事件的延迟方法 AddDomainEvent Domain\SeedWork\Entity.cs public abstr ...
- asp.net mvc webapi 实用的接口加密方法(转载)
在很多项目中,因为webapi是对外开放的,这个时候,我们就要得考虑接口交换数据的安全性. 安全机制也比较多,如andriod与webapi 交换数据的时候,可以走双向证书方法,但是开发成本比较大, ...
- net mvc webapi 实用
asp.net mvc webapi 实用的接口加密方法 在很多项目中,因为webapi是对外开放的,这个时候,我们就要得考虑接口交换数据的安全性. 安全机制也比较多,如andriod与webap ...
- NLayerAppV3--DDD之领域层
回顾:NLayerAppV3是一个使用.net 2.1实现的经典DDD的分层架构的项目. NLayerAppV3是在NLayerAppV2的基础上,使用.net core2.1进行重新构建的:它包含了 ...
- NLayerAppV3--.net Core2实现的DDD分层架构
虽然每天的工作都是CURD.还是使用着传统的三层架构.使用着.net Framework,但是这并不能影响我学习DDD和.net core. 总是希望软件在应对复杂多变的场景时能够游刃有余,在解决问题 ...
随机推荐
- sqlserver安装相关问题
最近在部署一个工程,数据库(sqlserver2005develop)遇到不少问题,下面将一一列出. 安装完毕后,无法连接到本地实例. 打开microsoft sql server 2005-> ...
- Home vs2013
Microsoft Visual Studio Ultimate 2013 版本 12.0.30110.00 Update 1 Microsoft .NET Framework 版本 4.5. ...
- 第二百二十六天 how can I 坚持
今天弟弟生日,只是简单的说了句生日快乐,幸亏看了下日历,要不又忘了. 在家待了一天. 明天还想去爬山,八大处太远了,该去哪呢. 不想在家待着. 日复一日,啊,年复一年啊.想想好可怕,人生,太快.该如何 ...
- Clean Code第二章<命名>
1.命名要有意义 错误写法 正确写法 2.某些构造函数可以提供有意义的静态方法去实现
- Skeletal Animation
[Skeletal Animation] Skeletal animation is the use of “bones” to animate a model. The movement of bo ...
- jy
222 DROP TABLE t_vhl_jy_car; CREATE TABLE t_vhl_jy_car( VEHICLE_JY_CODE ) PRIMARY KEY, VEHICLE_CODE ...
- Codeforces 719 E. Sasha and Array (线段树+矩阵运算)
题目链接:http://codeforces.com/contest/719/problem/E 题意:操作1将[l, r] + x; 操作2求f[l] + ... + f[r]; 题解:注意矩阵可以 ...
- HDU 4588 Count The Carries (数学,计数)
题意:给定两个十进制数,求二进制中,从x加到y的二进制进了多少位. 析:把这些数字的二进制纵向罗列出来,然后一位一位的把和加起来,最终得到总的进位数.从1到x,第i位上1的总数是x左移i+1位再右移i ...
- Win8制作和使用恢复盘
制作和使用恢复盘要制作恢复盘,请执行以下操作:注:确保计算机连接到交流电源.1. 将指针移至屏幕的右上角或右下角以显示超级按钮,然后单击搜索.2. 根据操作系统的不同,执行以下某项操作:• 在 Win ...
- MySQL事务处理和锁机制
事务处理和并发性 1.1 基础知识和相关概念 1 )全部的表类型都可以使用锁,但是只有 InnoDB 和 BDB 才有内置的事务功能. 2 )使用 begin 开始事务,使用 commit 结束事务, ...