Architecture models:
1-tier
Monolithic, “all-in-one” model – e.g. clients are “dumb” terminals connected directly to the mainframe.
Problems with the 1-tier model are :
• any change affects the entire system
• vertical scalability only – limited to the physical expansion capabilities of a single server
• single point of failure
• interoperability – limited connectivity
2-tier
Typically composed of multiple clients and a single server; the clients connect to the server over a network :
• client
The client is fat – e.g. implements the GUI, retrieves data from the server(s), performs business logic
based on the data.
• server
Typically a database. Provides a shared data-store for the client.
The server doesn’t typically implement business logic. Later revisions to the model implement some
of the business logic on the server as stored procedures (a.k.a. fat servers).
Problems with the 2-tier model are :
• the business logic may be complex and computationally expensive. Consequently, the client may
require powerful hardware
• client components are tightly coupled, not modular – e.g. a change to the GUI means shipping the
whole application to every client
• data retrieval - each client has to make a direct connection to each server it needs data from. Also,
the results transferred may be large and transferred using an inefficient (and perhaps proprietary)
protocol
• fat servers use stored procedures which aren't very portable.
n-tier
Composed of :
• client tier
Components that execute on the client. The business tier is common to all client types - some client
components talk to components in the business tier directly (e.g. thick clients such as EJB
application clients), others via the presentation tier (e.g. thin clients such as web browsers).
• presentation tier
Provides presentation specific support for the client tier. Acts as a proxy between the client tier and
the business tier. E.g. a servlet accepts HTTP requests from a web browser in the client tier. The
request is translated to a generic business event and passed to the business tier. Responses are
reformatted for presentation purposes (e.g. store result in session, generate HTML redirect for JSP)
and transmitted back over HTTP for display by the web browser.
• business tier
Implemented as business process objects (provide the business logic – e.g. session beans) and
business objects (provide an integrated, objectified view of the data tier with support for automated
synchronization – e.g. entity beans). The application server provides support for security,
transactions, pooling, caching etc. in this tier.
• data tier
Also known as the EIS tier (Enterprise Information System). Typical components include databases,
mainframes, socket servers, etc. Typically components in the business tier access the data tier
abstractly using a DAO (Data Access Object) helper class. The DAO takes care of the specifics of
data retrieval on behalf of the business objects.
Summary:
1-tier : Security and Maintainability?are Good, Availability, Scalability and extensibility are Poor.
2-tier : Mostly Poor, reliability Mixed
n-tier : Mostly Good, serviceability Mixed
博客介绍了三种架构模型。1-tier是“一体化”模型,存在影响全系统、扩展性有限等问题;2-tier由多客户端和单服务器组成,有业务逻辑复杂、组件耦合等问题;n-tier包含客户端层、表示层、业务层和数据层。总结指出1-tier安全和可维护性好但扩展性差,2-tier大多较差,n-tier大多较好。

4162

被折叠的 条评论
为什么被折叠?



