数据库设计外文翻译.doc

上传人:仙人指路1688 文档编号:2325349 上传时间:2023-02-11 格式:DOC 页数:12 大小:65.50KB
返回 下载 相关 举报
数据库设计外文翻译.doc_第1页
第1页 / 共12页
数据库设计外文翻译.doc_第2页
第2页 / 共12页
数据库设计外文翻译.doc_第3页
第3页 / 共12页
数据库设计外文翻译.doc_第4页
第4页 / 共12页
数据库设计外文翻译.doc_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《数据库设计外文翻译.doc》由会员分享,可在线阅读,更多相关《数据库设计外文翻译.doc(12页珍藏版)》请在三一办公上搜索。

1、 毕 业 设 计(论 文)外文文献翻译系 别: XXXXXXXXXXXX 专 业: XXXXXXXXXXXX 班 级: XXXXXXXXXXXX 学生姓名: XXX 导师姓名: XXXX 职称: XXXX 起止时间:2009年 3月2日 至 2009年 6月12 日英文原文Spring contains a lot of functionality and features, which are well-organized in seven modules shown in the diagram below. This section discusses each the of modul

2、es in turn.The Core package is the most fundamental part of the framework and provides the Dependency Injection features allowing you to manage bean container functionality. The basic concept here is the BeanFactory, which provides a factory pattern removing the need for programmatic singletons and

3、allowing you to decouple the configuration and specification of dependencies from your actual program logic. On top of the Core package sits the Context package, providing a way to access beans in a framework-style manner, somewhat resembling a JNDI-registry. The context package inherits its feature

4、s from the beans package and adds support for text messaging using e.g. resource bundles, event-propagation, resource-loading and transparent creation of contexts by, for example, a servlet container. The DAO package provides a JDBC-abstraction layer that removes the need to do tedious JDBC coding a

5、nd parsing of database-vendor specific error codes. Also, the JDBC package provides a way to do programmatic as well as declarative transaction management, not only for classes implementing special interfaces, but for all your POJOs (plain old java objects). The ORM package provides integration laye

6、rs for popular object-relational mapping APIs, including JDO, Hibernate and iBatis. Using the ORM package you can use all those O/R-mappers in combination with all the other features Spring offers, like simple declarative transaction management mentioned before. Springs AOP package provides an AOP A

7、lliance compliant aspect-oriented programming implementation allowing you to define, for example, method-interceptors and pointcuts to cleanly decouple code implementing functionality that should logically speaking be separated. Using source-level metadata functionality you can incorporate all kinds

8、 of behavioral information into your code, a little like .NET attributes. Springs Web package provides basic web-oriented integration features, such as multipart functionality, initialization of contexts using servlet listeners and a web-oriented application context. When using Spring together with

9、WebWork or Struts, this is the package to integrate with. Springs Web MVC package provides a Model-View-Controller implementation for web-applications. Springs MVC implementation is not just any implementation, it provides a clean separation between domain model code and web forms and allows you to

10、use all the other features of the Spring Framework like validation. Springs web MVC framework is designed around a DispatcherServlet that dispatches requests to handlers, with configurable handler mappings, view resolution, locale and theme resolution as well as support for upload files. The default

11、 handler is a very simple Controller interface, just offering a ModelAndView handleRequest(request,response) method. This can already be used for application controllers, but you will prefer the included implementation hierarchy, consisting of, for example AbstractController, AbstractCommandControll

12、er and SimpleFormController. Application controllers will typically be subclasses of those. Note that you can choose an appropriate base class: If you dont have a form, you dont need a FormController. This is a major difference to Struts.You can use any object as a command or form object - theres no

13、 need to implement an interface or derive from a base class. Springs data binding is highly flexible, for example, it treats type mismatches as validation errors that can be evaluated by the application, not as system errors. So you dont need to duplicate your business objects properties as Strings

14、in your form objects, just to be able to handle invalid submissions, or to convert the Strings properly. Instead, it is often preferable to bind directly to your business objects. This is another major difference to Struts which is built around required base classes like Action and ActionForm - for

15、every type of action.Compared to WebWork, Spring has more differentiated object roles. It supports the notion of a Controller, an optional command or form object, and a model that gets passed to the view. The model will normally include the command or form object but also arbitrary reference data. I

16、nstead, a WebWork Action combines all those roles into one single object. WebWork does allow you to use existing business objects as part of your form, but only by making them bean properties of the respective Action class. Finally, the same Action instance that handles the request is used for evalu

17、ation and form population in the view. Thus, reference data needs to be modeled as bean properties of the Action too. These are arguably too many roles for one object.Springs view resolution is extremely flexible. A Controller implementation can even write a view directly to the response, returning

18、null as ModelAndView. In the normal case, a ModelAndView instance consists of a view name and a model Map, containing bean names and corresponding objects (like a command or form, containing reference data). View name resolution is highly configurable, either via bean names, via a properties file, o

19、r via your own ViewResolver implementation. The abstract model Map allows for complete abstraction of the view technology, without any hassle. Any renderer can be integrated directly, whether JSP, Velocity, or any other rendering technology. The model Map is simply transformed into an appropriate fo

20、rmat, such as JSP request attributes or a Velocity template model.Pluggability of other MVC implementationsThere are several reasons why some projects will prefer to use other MVC implementations. Many teams expect to leverage their existing investment in skills and tools. In addition, there is a la

21、rge body of knowledge and experience avalailable for the Struts framework. Thus, if you can live with Struts architectural flaws, it can still be a viable choice for the web layer. The same applies to WebWork and other web MVC frameworks.If you dont want to use Springs web MVC, but intend to leverag

22、e other solutions that Spring offers, you can integrate the web MVC framework of your choice with Spring easily. Simply start up a Spring root application context via its ContextLoaderListener, and access it via its ServletContext attribute (or Springs respective helper method) from within a Struts

23、or WebWork action. Note that there arent any plugins involved, so no dedicated integration is necessary. From the web layers point of view, youll simply use Spring as a library, with the root application context instance as the entry point.All your registered beans and all of Springs services can be

24、 at your fingertips even without Springs web MVC. Spring doesnt compete with Struts or WebWork in this scenario, it just addresses the many areas that the pure web MVC frameworks dont, from bean configuration to data access and transaction handling. So you are able to enrich your application with a

25、Spring middle tier and/or data access tier, even if you just want to use, for example, the transaction abstraction with JDBC or Hibernate.Features of Spring MVCSprings web module provides a wealth of unique web support features, including:Clear separation of roles - controller, validator, command ob

26、ject, form object, model object, DispatcherServlet, handler mapping, view resolver, etc. Each role can be fulfilled by a specialized object.Powerful and straightforward configuration of both framework and application classes as JavaBeans, including easy referencing across contexts, such as from web

27、controllers to business objects and validators.Adaptability, non-intrusiveness. Use whatever controller subclass you need (plain, command, form, wizard, multi-action, or a custom one) for a given scenario instead of deriving from a single controller for everything.Reusable business code - no need fo

28、r duplication. You can use existing business objects as command or form objects instead of mirroring them in order to extend a particular framework base class.Customizable binding and validation - type mismatches as application-level validation errors that keep the offending value, localized date an

29、d number binding, etc instead of String-only form objects with manual parsing and conversion to business objects.Customizable handler mapping and view resolution - handler mapping and view resolution strategies range from simple URL-based configuration, to sophisticated, purpose-built resolution str

30、ategies. This is more flexible than some web MVC frameworks which mandate a particular technique.Flexible model transfer - model transfer via a name/value Map supports easy integration with any view technology.Customizable locale and theme resolution, support for JSPs with or without Spring tag libr

31、ary, support for JSTL, support for Velocity without the need for extra bridges, etc.A simple but powerful tag library that avoids HTML generation at any cost, allowing for maximum flexibility in terms of markup code.Data Access using O/R MappersSpring provides integration with Hibernate, JDO, Oracle

32、 TopLink, Apache OJB and iBATIS SQL Maps: in terms of resource management, DAO implementation support, and transaction strategies. For example for Hibernate, there is first-class support with lots of IoC convenience features, addressing many typical Hibernate integration issues. All of these support

33、 packages for O/R mappers comply with Springs generic transaction and DAO exception hierarchies. There are usually two integration styles: either using Springs DAO templates or coding DAOs against plain Hibernate/JDO/TopLink/etc APIs. In both cases, DAOs can be configured through Dependency Injectio

34、n and participate in Springs resource and transaction management.Springs adds significant support when using the O/R mapping layer of your choice to create data access applications. First of all, you should know that once you started using Springs support for O/R mapping, you dont have to go all the

35、 way. No matter to what extent, youre invited to review and leverage the Spring approach, before deciding to take the effort and risk of building a similar infrastructure in-house. Much of the O/R mapping support, no matter what technology youre using may be used in a library style, as everything is

36、 designed as a set of reusable JavaBeans. Usage inside an ApplicationContext does provide additional benefits in terms of ease of configuration and deployment; as such, most examples in this section show configuration inside an ApplicationContext.Some of the the benefits of using Spring to create yo

37、ur O/R mapping DAOs include:Ease of testing. Springs inversion of control approach makes it easy to swap the implementations and config locations of Hibernate SessionFactory instances, JDBC DataSources, transaction managers, and mapper object implementations (if needed). This makes it much easier to

38、 isolate and test each piece of persistence-related code in isolation.Common data access exceptions.Spring can wrap exceptions from you O/R mapping tool of choice, converting them from proprietary (potentially checked) exceptions to a common runtime DataAccessException hierarchy. This allows you to

39、handle most persistence exceptions, which are non-recoverable, only in the appropriate layers, without annoying boilerplate catches/throws, and exception declarations. You can still trap and handle exceptions anywhere you need to. Remember that JDBC exceptions (including DB specific dialects) are al

40、so converted to the same hierarchy, meaning that you can perform some operations with JDBC within a consistent programming model.General resource management. Spring application contexts can handle the location and configuration of Hibernate SessionFactory instances, JDBC DataSources, iBATIS SQL Maps

41、 configuration objects, and other related resources. This makes these values easy to manage and change. Spring offers efficient, easy and safe handling of persistence resources. For example: Related code using Hibernate generally needs to use the same Hibernate Session for efficiency and proper tran

42、saction handling. Spring makes it easy to transparently create and bind a Session to the current thread, either by using an explicit template wrapper class at the Java code level or by exposing a current Session through the Hibernate SessionFactory (for DAOs based on plain Hibernate3 API). Thus Spri

43、ng solves many of the issues that repeatedly arise from typical Hibernate usage, for any transaction environment (local or JTA).Integrated transaction management. Spring allows you to wrap your O/R mapping code with either a declarative, AOP style method interceptor, or an explicit template wrapper

44、class at the Java code level. In either case, transaction semantics are handled for you, and proper transaction handling (rollback, etc) in case of exceptions is taken care of. As discussed below, you also get the benefit of being able to use and swap various transaction managers, without your Hiber

45、nate/JDO related code being affected: for example, between local transactions and JTA, with the same full services (such as declarative transactions) available in both scenarios. As an additional benefit, JDBC-related code can fully integrate transactionally with the code you use to do O/R mapping.

46、This is useful for data access thats not suitable for O/R mapping, such as batch processing or streaming of BLOBs, which still needs to share common transactions with O/R mapping operations.To avoid vendor lock-in, and allow mix-and-match implementation strategies. While Hibernate is powerful, flexi

47、ble, open source and free, it still uses a proprietary API. Furthermore one could argue that iBATIS is a bit lightweight, although its excellent for use in application that dont require complex O/R mapping strategies. Given the choice, its usually desirable to implement major application functionali

48、ty using standard or abstracted APIs, in case you need to switch to another implementation for reasons of functionality, performance, or any other concerns. For example, Springs abstraction of Hibernate transactions and exceptions, along with its IoC approach which allows you to easily swap in mappe

49、r/DAO objects implementing data access functionality, makes it easy to isolate all Hibernate-specific code in one area of your application, without sacrificing any of the power of Hibernate. Higher level service code dealing with the DAOs has no need to know anything about their implementation. This approach has the additional b

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号