java软件架构设计方案.pdf

所需积分/C币:49 2016-11-18 11:40:10 606KB PDF
115
收藏 收藏
举报

java软件架构设计方案.pdf
环境搭建 包结构搭建,如图 Project com.newlandaddur 出 由 com.newland. b E com. newland. frastr ucture, exception tt wrtl. [ ard. asLt utLure. Friberrlale > it com. newland. frastructure, repository b E com. newland. frastructure, ut Is D由 com. newland juni D出 com. newland, service 配置 配置 首先添加 点击工栏右键→ 如图 所 Go Into b wE. Quarche-ks java D ws BaseCrty ava sng士 atheIr s Open in New Window BaccDrovinccDAo da T pe Hierarchy 68 Show in At-Shf+W卜69 70 Ctrl+insert TODO Auto-gen 增 Copy Qual fied Name Ch Open in Explorer Paste City Add and RemEve Project Deploy. Delete De ete Add XFire Web Serice Capabilities Build path Add REST Web Service Capabilities Source At+Shit+S卜 Add Tapestry Capabilities. At+shift+Tk Add struts capabilites Capabi ities 心 I Import Add Report capabil ties. Add Portlet Capabi ities. Add JPA Capabilities LoseRs e Add JSF Capabilities Close Unrelated Projects Add jstl libraries ssign Working Sets. Add Hibernate Capa bi ≤ Run As Run xdoclet Profile as l Genarate UML2 Class Diagram Tear Run validatio Exclude from valid=tion Rest=re from local h st Marage validation 8 MyEclipse Remove all validation markers Configure Properties Alt+ente 选择 拦截所有 请求。 配置 点击工程右键→ Add Spring Capabilities Add spring Capabilities Add MyEclipse Spring and User libraries to project Spring version: o Spring 1.2 O Spring 2.0o Spring 2.5 o) Spring 3.0 Select the libraries to add to the buildpath show: E MyEclipse Libraries F User Libraries W iSpring 3.0 AOP Libraries-<MyEclipse-Library> Spring 3.0 Core Libraries-sMy Lir△ v Spring 3.0 Persistence Core I ihraries-sMyFcl nse-library? W Spring 3.0 Persistence JDBC Libraries- <MyEclipse-Library> E Spring 3.0 Persistence JDO Librarias-MYEclipse-Library> jew and edit libraries JAR Library InstallatiOn o Add checked Libraries to project bu ld-peth Copy checked Library contents to project folder TLDs always copied jars/zins d baria B Tag Library Installation Tag Library Folder: <no taglibs in selected libraries> Browse Back Next Cancel 添加相关的包,我这里添加了除 之外的所有包。 点击然后 配置 首先配置 。点击 右上角的 ,如图 哥 Java MyEcli 9 MyEclipse Hiber P MyEclipse Database Explorer y Debug Eo Team Synchronizing CUs CVS Repository Exploring 6 MyEclipse Java Enterprise 在左边的 区域右键 2S Database Driver New database connection driver Create new connection driver Driver template:Axion Driver name: testSSH Connection LKL: jdbc: oracle thin: (01y2 168 0.9/: 1521:hypro User nane: bj an mals assword Driver JARs ∧ dd jar Remove Drivcr dassnamc: orade jdbc driver Orac eDriver Test drm'e a Connect to database on MyEclipse startup 回 Save password 6 Saved passwords are stored on your computer in a file that's difficult, but 旦ack Finish Cancel 准备工作完成以后继续向工程生添加 添加方法:右键点击工程→ 如图: d Spring 3. 0 Fersislente JDBC Libr a ie, Ityuiitd fur Spr iriy-Hibernel support Hibernsta Specificaton: Hiber nate O HiEemate 3C Hibernate 3 1 0 Hibernate 3. 2o Hibernate 3.3 F Enable hibernate Annotations Support Select the libraries to add to the buldpath Show MyEclipse Libraries Uscr Librari:: D Hibernate 3.3 Annotations Entity Manager.<MyEclipse-Librery= V Hibcrnato 3.3 Corc Librerics -MyEipsc Library- a Spring 3.0 Persistence JDBC Libraries -< MyEclipse-Library> View and edt libraries o Adu hecked Liu ali: lu prue.l build-palh O Copy checked Library Jars to project folder and adc to Euild-path Libray " older: xno iors/zps n selected libraries Back Ncxt x 选择默认点击 S Add Hibernate Capabilit es Hibernate Confiquration The wwwwwwwwwwwwwwww project is configured writh Spring capabi ities Se ell the lype ul-unliyureliunl file My Eclipse Hibeir ale Tuuls will use lur Lh is projet: g Hibernate configuration file(hibernate. cfg xml) O Spring confi]u rainn file (application ontex. xm) 1. Create a new hibernate corfig file or specify an existing config file 2. Optional: Define a Hibernate Sessicn Factory in Spring config file 3. Optional: Define data base connection deta ls ≤Back Finish 点击如图 auld Hibettule Capabilites Defire Fihernare ard Spring configuration details Hibernate configuration fie to be used by Myeclipse Hibernate Oclc: O Existing Hibernate configuration file Fla name: hibernate. cfam Hibernate ools for Spring Configuration Support Create Spring H bernate Sassionkactcry using"config Locat on"property to refererce Hibernate configuration fila defined ahnve pring Config: src/appl cation Context.xml SessionFactory Id: sessionFactory FiNish 点击选择刚才准备好的数据源,如图 2 Add Hibernate Capabilities Spring hibernate Support for Myeclipse Suecily i ew Suriny DalaSwuite cuIr letl vnl d=a Is v SFccity Spring data SoUrce ccnnccticn details? DataSource: 9 Usa JDEC Driver Use JNDI Data Source E Copy CE driver jar's) to project and add to bu ldpath Connect URL: jdbc ceClor &:@- databAse_name Driver Cass: oracle dbc. driver. CraclsDriver Orare 9/10g Search Enable dynamic DB table creation 点击 Add Hibernate Capabilities Session Factory for MyEclipse Define Session actory properties ava CuIHp iarILt Level:( Java 1.4 Java 5 NeoL Fiish Canel 选择不需要创建 配置持久层 用 标签写类 Dept java 2s 1 package co, newlal m三1n 3+import java. util. HashSet 5 8+* Dert entity, author MyEclipse Persistence Tools 10 12 14 15* dynamic-insert="true 17 a 18 public class Dept implements java.io serializable t 19 20 / Fields 23 private string deptid 4 private string deptno; 25 private string ceptnamei 26 private String remarks 27 privaTe SeL employee new HoshiSeL(. 28 29 再在每个属性的方法上面添加对应的 标签,如图: w@ hibernate.⊥d generator-class=1 public string getDeptid() i return deptidi 配置 用于配置数据库连接,如图 hibernate dialect oro hibernate dialect oracleDialectr hliLerIld Le. corulec Lion driver class oracle. jac. driver. OLdcletrivert hibernate connection. url jdbc:oracle: thin: E192168.0.100: 1521: NEALANLW hibernate connection. username testl+ hibernate connection. pas sword testle hibernate connection. pocl size hibernate. statement cache size=6u hibernate. show sc==rew 的配置,如图 (?vml version="I, 0" encoding=nutI-32 2-proicct namc-"'Hibormatc Ekamclc" dofault-kaccdir-" property name-"xdoclet. lib. home" vaiue-"G:\xdoclet 1.2.3 overlY Iaie-kruperLiesdis"val property name="hibernate. lib. home" value="D: \workspaces \MyEclipse 8. 6\3*h\webRoot\WEB-INE\Iib\ibernace3"/ property name="comj. lib. home" value="D: workspaces \My=clipse 8. 6\a%h NebRooTWEH-IMr\lib\ribernate3\lib"/> 7 <property name="adhc libs valle=D: Workspaces \ MyEclipse E. 6\axh\WebRoot \WEB-INF\Iib\ojabc14/> e <property name="database type" value="oracle"/ propcrty xsdoclob. rcot, dir valuc-"C: xdoclct-1 2.3 <Property name- 1c.1让b,dir"va1ue-"(zdc1at,x=,x】/1ib"/> Fe Lh i: -"saruplicldsspaLhI'Y 132 1⊥ eset C1r=”5Xac1et.1⊥D.a1 inc I1 '/fileset> A/path 20- <target name="Javazhbm unless="nibernatedoclet unnecessary description="creating Hibernate mapping 欣入 hibernated12t"1a9xame=xc1e=mh1e9.上erna=.且 ibesnateDecletTask' asspathref-sampleclasspa clacton leset dir=nEi xdoclet. ib heme) <nc1 ue name="",jax”/ fileset dir- <inc1 e name=w,*”> </ti last> 右击鼠标,选择“ 选择 选项,如图: external lools Conf guratic Create. manage, and run confiquration Rur an Ant bu ld file 目8二 Name: Project b uil.xml Ant RIid G Main(+ Retresh(Gg Build ws Targets% Classpath( <B) Properties EA JRE B Env ronmentD) :: axh build xl Check targets te execute 祟pr pRogram va2h... Creat ng Hibernate mapping 回画hb 2 out of3 se ecec □ Sort targets L Hide interna targets not ce ected for execution der: nbr2cdl, java2hb1 Order Filter matched d of 4 items n 选中前两个选项,然后“”便会自动生成相应的配置文件和数据库 33技术应用 数据库动态生成技术和框架 通过使用使用 技术,从而实现文件和数据库从代码生成,这大大提高了 在廾发阶段数据库应对业务变化的能力。 同时采用框架,可以隐藏数据访问的细节,使得与数据库交互变得简单易行,并且完全不用考 虑具体的语句,从而实现快速开发,也不会因开发人员的水平而出现各种人为的性能问题。 面向方面编程 使用 柱架来实现技术。通过利用技术,分离出核心关注点和横切关注点。在实现 了诸如日志、事务管理、权限控制等横切关注点的通用逻辑后,开发人员就可以专注于核心关注点,将 精力投入到解决全业的商业逻辑上来。同时,这些封装好了的横切关注点提供的功能,可以最大限度地 复用于商业逻辑的各个部分,既不需要开发人员作特殊的编码,也不会因为修改横切关注点的功能而影 响具体的业务功能 实现依赖注入和() 使用 实现依赖注入 )机制。分层架构的设计,层与层之间是松散耦 合的。“松散耦合”实际是指上层类不能只体依赖于下层,而应该依赖于下层提伕的一个接口。这样,上 层不能直接实例化下层屮的类,而只持有接口,至于接口所指变量最终究竞是哪一个类,则由依赖注入 机制决定。 34可能的技术应用及替代方案 数据库访问部分 采用框架将山更多选择: 等等;项日较小的情况,也可以使用直 接进行数据访问。 可重用模块部分 日志、异常及验证等可重用模块可采用插件提供一致的功能,也可以根据每一模块采用一些技 术框架,甚至白己廾发。比如凵志模块还可使用 等 杨扬,工科

...展开详情
试读 10P java软件架构设计方案.pdf
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
  • GitHub

    绑定GitHub第三方账户获取
  • 签到新秀

    累计签到获取,不积跬步,无以至千里,继续坚持!
  • 分享达人

    成功上传6个资源即可获取
关注 私信
上传资源赚积分or赚钱
最新推荐
java软件架构设计方案.pdf 49积分/C币 立即下载
1/10
java软件架构设计方案.pdf第1页
java软件架构设计方案.pdf第2页

试读结束, 可继续读1页

49积分/C币 立即下载 >