标记方式:封装

访问修饰符

面向对象的语言把一个程序分成模块调用的类。每个类包含的功能,其由数据(字段)和方法。(并非所有的语言都使用这些术语,但他们会为这个事。)语言有什么其他的类可以访问类的特征的各种规则,这些通常是基于适用于一类访问修饰符。

by Martin Fowler

13 May 2003

Read more…

bliki

封装语言功能

bet188足球设计继承

一个面向对象界最长的运行参数之间的争论OpenInheritance并设计继bet188足球承。设计继承的原理是通过可能是最好的总bet188足球结Josh Bloch:“设bet188足球计与继承的文件,否则禁止它”。用这种方法你照顾决定哪些方法可以被继承和Seal其他人阻止他们被覆盖。

by Martin Fowler

6 Oct 2006

Read more…

bliki

封装API设bet188足球计

嵌入式文件

通过服务器流动JSON数据结构是什么我看到越来越多的这些日子。JSON文件可以通过使用直接持久,AggregateOrientedDatabaseserialized LOB在关系数据库中。JSON文件也可以直接提供给Web浏览器或用于将数据传输到服务器端页面渲染器。当以这种方式使用JSON,我听人说,使用面向对象语言的方式得到,因为JSON需要被翻译成对象只能再次呈现出来 - 编程工作的浪费。我同意关于垃圾了点,但我认为它是不是对象,但不懂得封装的一个问题。

by Martin Fowler

4 Jun 2013

Read more…

bliki

NOSQL封装对象协作设计bet188足球

封装系列

如果你了解面向对象的设计,你很快就会知道它封装您的数据是非常重要的。bet188足球封装的最简单的形式是使用访问器(获取和设置方法)或属性 - 如果你的语言支持它。(有些人甚至为此在类中 -SelfEncapsulation

by Martin Fowler

Read more…

bliki

封装

函数作为对象

在编程时,对象的基本概念是数据和行为的捆绑。这写了一组相关的函数时提供了一个通用的数据上下文。它也提供了一个接口,以操纵该允许对象到数据控制访问数据,因此很容易支持派生数据,并防止数据的无效修改。许多语言提供明确的语法来定义类,它们充当对象的定义。但是,如果你有一流的功能和闭包的语言,则可以利用这些结构创建使用该功能的对象模式(最初由尤金·沃灵福德描述)的对象。

吸气根除

您可以通过在当他们看到一个getter方法口的左侧的抽搐告诉他们,有迅速拉他们的战斧和满意的叫声作为另一次吸气时从类毫不留情地凿成其在感激的狂喜立刻昏睡 the manly Getter Eradicator's feet.

观测状态

What do people mean when they say a method doesn't change the observable state of an object?

by Martin Fowler

5 Jan 2006

Read more…

bliki

封装

打开继承

这是相反的态度,DesignedInheritance。开放继承主张不要期待通过以禁止继承Seal荷兰国际集团自己的班级或做别的任何事来阻止人们继承的类。

by Martin Fowler

Read more…

bliki

封装API设bet188足球计

Page对象

当你写对一个网页测试,您需要参考该网页中的元素,以点击链接,并确定钱包显示的。然而,如果你写操作HT的测试ML elements directly your tests will be brittle to changes in the UI.A page object wraps an HTML page, or fragment, with an application-specific API, allowing you to manipulate page elements without digging around in the HTML.

by Martin Fowler

10 Sep 2013

Read more…

bliki

测试封装Web开发

Presentation Domain Data Layering

One of the most common ways to modularize an information-rich program is to separate it into three broad layers: presentation (UI), domain logic (aka business logic), and data access.So you often see web applications divided into a web layer that knows about handling HTTP requests and rendering HTML, a business logic layer that contains validations and calculations, and a data access layer that sorts out how to manage persistent data in a database or remote services.

Protected Data

Is it good OO design to have data in my classes with theprotectedAccessModifier?

by Martin Fowler

14 May 2003

Read more…

bliki

封装语言功能

Public Csharp Fields

When I first came across C# I liked the notion of properties right from the start.The getX and setX conventions of C++/Java always seems rather silly to me, it's much more natural to writeobj.X = other.X。Providing a property with get and set methods turns a common convention into a naturally supported feature of the language.

by Martin Fowler

4 Feb 2004

Read more…

bliki

封装语言功能

Published Interface

Published Interfaceis a term I used (first in188足球比分直播) to refer to a class interface that's used outside the code base that it's defined in.As such it means more than public in Java and indeed even more than a non-internal public in C#.In my column for IEEE Software I argued thatthe distinction between published and public is actually more important than that between public and private.

Seal

Sealing a method or a class prevents subclasses from overriding it.

by Martin Fowler

Read more…

bliki

封装API设bet188足球计

Self Encapsulation

Data encapsulation is a central tenet in object-oriented style.This says that the fields of an object should not be exposed publicly, instead all access from outside the object should be via accessor methods (getters and setters).There are languages that allow publicly accessible fields, but we usually caution programmers not to do this.Self-encapsulationgoes a step further, indicating that allinternalaccess to a data field should also go through accessor methods as well.Only the accessor methods should touch the data value itself.If the data field isn't exposed to the outside, this will mean adding additional private accessors.

by Martin Fowler

9 Mar 2017

Read more…

bliki

封装

Tell Dont Ask

Tell-Don't-Ask is a principle that helps people remember that object-orientation is about bundling data with the functions that operate on that data.It reminds us that rather than asking an object for data and acting on that data, we should instead tell an object what to do.This encourages to move behavior into an object to go with the data.

Uniform Access Principle

All services offered by a module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation.

-- Bertrand Meyer

Bertrand Meyer coined this principle in his highly-influential bookObject-Oriented Software Construction

The essential point of the principle is that if you have a person object and you ask it for its age, you should use the same notation whether the age is a stored field of the object or a computed value.It effectively means that a client of the person should neither know nor care whether the age is stored or computed.


所有标签

API设bet188足球计·敏捷·敏捷实施·分析模式·应用架构·应用集成·坏事·大数据·棋牌游戏·构建脚本·证明·合作·计算机历史·会议板·会议·持续交付·新冠肺炎·数据库·bet188足球·字典·分布式计算杂志·改道·多样·文件·领域驱动设计bet188足球·领域特定语言·国内·封装·企业架构·估计·事件架构·进化设计bet188足球·体验报告·expositional架构·极限编程·前端·小工具·IEEE软件·infodecks·网络文化·面试·语言功能·语言工作台··传统康复·法律·指标·微服务·移动·NOSQL·对象协作设计bet188足球·解析器生成器·摄影·播客·流行·演示技术·隐私·过程理论·生产率·编程平台·编程风格·项目计划·招聘·188足球比分直播·188足球比分直播重构边界·需求分析·红宝石·安全·视频通话·团队环境·团队组织·技术债务·技术领先·测试类别·测试·ThoughtWorks的·工具·旅行·UML·版本控制·Web开发·网页服务·网站·写作

2020·2019·2018·2017年·2016·2015年·2014·2013·2012·2011·2010·2009年·2008年·2007年·2006年·2005年·2004年·2003·2002年·2001年·2000·1999年·1998年·1997年·1996年

All Content