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. 总是希望软件在应对复杂多变的场景时能够游刃有余,在解决问题 ...
随机推荐
- HDU ACM 1325 / POJ 1308 Is It A Tree?
Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- openstack kilo 流量
- 常见的mongo shell命令
启动mongo shell 在windows下,双击mongo.exe可以启动mongo shell 查询库.表及选择库 查询所有库命令: show dbs 应用某一个db use jxs_datab ...
- webconfig文件serviceHostingEnvironment节点出错的解决方法
在三点五和二版本的配置中可以出现这个节点,但是在4.0是没有的,所以如果框架是4.0的时候要除去这个节点,不然就会报以下错误: Configuration Error Description: An ...
- CSS画出的各种形状图
利用CSS可以画出各种需要的图形目录[1]矩形[2]圆形[3]椭圆[4]直角三角形[5]正三角形[6]平行四边形[7]梯形[8]六角星[9]六边形[10]五角星简单图形 矩形div{ width: 1 ...
- 【LeetCode】 Subsets
Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be ...
- POJ3974 Palindrome (manacher算法)
题目大意就是说在给定的字符串里找出一个长度最大的回文子串. 才开始接触到manacher,不过这个算法的确很强大,这里转载了一篇有关manacher算法的讲解,可以去看看:地址 神器: #includ ...
- PetaPoco 笔记
PetaPoco是一款适用于.Net 和Mono的微小.快速.单文件的微型ORM. PetaPoco有以下特色: 微小,没有依赖项--单个的C#文件可以方便的添加到任何项目中. 工作于严格的没有装饰的 ...
- AFNetWorking3.0使用 自签名证书的https请求
前几日,项目组出于安全角度的考虑,要求项目中的请求使用https请求,因为是企业内部使用的app,因此使用了自签名的证书,而自签名的证书是不受信任的,所以我们就需要自己来做证书的验证,包括服务器验证客 ...
- Kafka学习记录
1 Kafka的基本介绍 Apache Kafka是分布式发布-订阅消息系统.它最初由LinkedIn公司开发,之后成为Apache项目的一部分.具有快速.可扩展.分布式.可复制等特点.Kafka与传 ...