企业级应用系统体系架构一简介.ppt
《企业级应用系统体系架构一简介.ppt》由会员分享,可在线阅读,更多相关《企业级应用系统体系架构一简介.ppt(95页珍藏版)》请在三一文库上搜索。
1、企业级应用系统体系架构(一) 简介,2019/4/14,课程开设目的,开设本课的目的就是要让软件学院的本科生能够构建企业级分布式应用系统 不但知道该如何做,并且还要知道为什么那样做,以及如何才能做好 与信息系统建模课程形成有机的集成,了解企业应用系统从建模到设计实现的完整过程和方案,前导内容,什么是企业应用系统 中间件技术 软件构件技术及其后继技术 Java EE与.NET简介 XML及其应用 注解 访问数据库-JDBC&ADO.NET JavaBean构件 事务管理 消息管理 RMI与EJB EJB3.0中的会话Bean EJB3.0中的实体Bean EJB3.0中的消息驱动Bean,3,授
2、课主题与内容,本课授课17次,每次2学时,共34学时: 基于构件的分析与设计技术 安全控制、事务管理、消息机制、表示层开发技术 Web Services技术 Java EE中的Web Services .NET中的Web Services 基于RESTful的WS Web2.0技术 Ajax和Flex SOA技术 SOA 基础理论、面向服务的分析与设计、SOA实现方式举例 企业级应用系统体系架构的主要质量属性,以及实现对这些质量属性的要求可以采用的设计策略。,考核方式,课程大作业 该课程大作业将与信息系统建模课程的大作业统一 大作业以小组为单位完成 大作业考核将与信息系统建模课程一并进行,从不
3、同角度考核给分 部分大作业将与摩根史坦利合作 成绩构成 课程大作业中期检查20%,第11周周末(5月7-8日) 课程大作业期末验收50% 期末考试30%,闭卷笔试,助教与答疑,助教 王文婷 答疑 陈昊鹏:周三14:00-16:00 软件大楼1111 王文婷:周三14:00-16:00 软件大楼5402 摩根工程师:项目组协商,企业级应用系统体系架构(一) 架构特征,2019/4/14,What is Enterprise Application,Enterprise applications often have complex data - and lots of it - to work
4、 on, together with business rules that fail all tests of logical reasoning. Other terms for enterprise applications include “information systems“ Enterprise applications include payroll, patient records, shipping tracking, cost analysis, credit scoring, insurance, supply chain, accounting, customer
5、service, and foreign exchange trading. Enterprise applications dont include automobile fuel injection, word processors, elevator controllers, chemical plant controllers, telephone switches, operating systems, compilers, and games.,What is Enterprise Application,Enterprise applications usually involv
6、e persistent data usually have a lot of data usually many people access data concurrently usually have a lot of user interface screens usually they need to integrate with other enterprise applications scattered around the enterprise conceptual dissonance with the data complex business “illogic“,10,企
7、业应用系统的特征,一个企业系统是具备下列性质的系统: 共享某些或全部在应用中被使用的资源 规划成为内部使用 必须在现有的架构内运行 将由内部IT员工部署并提供支持 需要更强的健壮性,对于异常处理和可扩展性都是如此 只能适度地失败 必须合理地处理系统随时间推移而发生的演化,Dimensions of software complexity,Higher technical complexity - Embedded, real-time, distributed, fault-tolerant - Custom, unprecedented, architecture reengineering
8、 - High performance,Lower technical complexity - Mostly 4GL, or component-based - Application reengineering - Interactive performance,Higher management complexity - Large scale - Contractual - Many stake holders - “Projects”,Lower management complexity - Small scale - Informal - Single stakeholder -
9、 “Products”,An average software project - 5-10 people - 3-9 month duration - 3-5 external interfaces - Some unknowns & risks,Typical System Architecture,What is Software Architecture,Enterprise/Product Architecture,Business Architecture,Application Architecture,Technical Architecture,Product Archite
10、cture,Software Architecture Quality Metrics,Availability Reliability Modifiability Performance Security Testability Usability Supportability,Other factors to consider,Business objectives(T2M,Targeted Market) Skill of development team and local market of team Cost to build and Maintain v.s. Benefit M
11、ateriality of Technology Current System constrain, integration Migration, migration, migration,Summary,Software Architecture need to consider from both technical point of view as well as business point of view There are different ways to communicate architecture design There is no THE best architect
12、ure for any one software system Always need consider external constrain, such cost, infrastructure, Maturity of IT organization, not only development, but also operations Architecture is a live entity, therefore, ability to grow, migrate is very important,16,企业级应用系统体系架构(一) 安全1,2019/4/14,From: Prenti
13、ce.Hall.PTR: Core Java 2 Volume II Advanced Features,8th.Edition. Apri.2008.,17,内容提要,类加载器 字节码校验 安全管理器与访问权限 数字签名 代码签名 加密,18,类加载器,Java编译器能够将源程序转化为假想机器的机器语言,这种机器称为虚拟机。解释器能够将虚拟机的指令集翻译成目标机器的机器语言。 请注意,虚拟机只加载程序执行时所需要的类文件。例如,假设程序从MyProgram.class开始运行,下面是虚拟机执行的步骤: 虚拟机有一个用于加载类文件的机制,例如,从磁盘上读取文件或者请求web上的文件;它使用该机
14、制来加载MyProgram类文件中的内容。 如果MyProgram类拥有类型为另一个类的实例变量,或者是拥有超类,那么这些类文件也会被加载。(加载某个类所依赖的所有类的过程称为类的解析。) 接着,虚拟机执行MyProgram中的main方法(它是静态的,无需创建类的实例)。 如果main方法或者main调用的方法要用到更多的类,那么接下来就会加载这些类。,19,类加载器,然而,类加载机制并非只使用单个的类加载器。每个Java程序至少拥有三个类加载器: 引导类加载器 扩展类加载器 系统类加载器(有时也称为应用类加载器),20,类加载器,引导类加载器负责加载系统类(通常从JAR文件rt.jar中进
15、行加载)。它是虚拟机整体中的一部分,而且通常是用C语言来实现的。引导类加载器没有对应的ClassLoader对象,例如,该方法 String.class.getClassLoader() 将返回null。 扩展类加载器用于从jre/lib/ext目录加载“标准的扩展”。你可以将JAR文件放入该目录,这样即使没有任何类路径,扩展类加载器也可以找到其中的各个类。 系统类加载器用于加载应用类。它在由CLASSPATH环境变量或者-classpath命令行选项设置的类路径中的目录里或者是JAR/ZIP文件里查找这些类。 在Sun公司的Java语言实现中,扩展类加载器和系统类加载器都是用Java来实现的
16、。它们都是URLClassLoader类的实例。,21,类加载器,类加载器有一种“父子”关系。除了引导类加载器外,每个类加载器都有一个父类加载器。根据规定,类加载器会为它的父类加载器提供一个机会,以便加载任何给定的类,并且只有在其父类加载器加载失败时,它才会加载该给定类。例如,当要求系统类加载器加载一个系统类(比如,java.util.ArrayList)时,它首先要求扩展类加载器进行加载,该扩展类加载器则首先要求引导类加载器进行加载。引导类加载器查找并加载rt.jar中的这个类,而无须其他类加载器做更多的搜索。,22,将类加载器作为命名空间,每个Java程序员都知道,包的命名是为了消除名字冲
17、突。在标准类库中,有两个名为Date的类,它们的实际名字分别为java.util.Date和java.sql.Date。使用简单的名字只是为了程序员的方便,它们要求程序要包含恰当的import语句。在一个正在执行的程序中,所有的类名都包含它们的包名。 然而,令人惊奇的是,在同一个虚拟机中,可以有两个类,它们的类名和包名都是相同的。类是由它的全名和类加载器来确定的。这项技术在加载来自多处的代码时很有用。例如,浏览器为每一个web页都使用了一个独立的applet类加载器类的实例。这样,虚拟机就能区分来自不同web页的各个类,而不用管它们的名字是什么。,23,编写你自己的类加载器,如果要编写自己的类
18、加载器,你只需要继承ClassLoader类,然后覆盖下面这个方法 findClass(String className) ClassLoader超类的loadClass方法用于将类的加载操作委托给其父类加载器去进行,只有当该类尚未加载并且父类加载器也无法加载该类时,才调用findClass方法。 如果要实现该方法,你就必须: 为来自本地文件系统或者其他来源的类加载其字节码。 调用ClassLoader超类的defineClass方法,向虚拟机提供字节码。,24,编写你自己的类加载器,我们建立了一个类加载器,用于加载加密过的类文件。该程序要求用户输入第一个要加载的类的名字(即包含main方法的
19、类)和密钥。然后,使用一个专门的类加载器来加载指定的类并调用main方法。该类加载器对指定的类和所有被其引用的非系统类进行解密。最后,该程序调用已加载类的main方法。,25,编写你自己的类加载器,class CryptoClassLoader extends ClassLoader /* Constructs a crypto class loader. param k the decryption key */ public CryptoClassLoader(int k) key = k; protected Class findClass(String name) throws Cla
20、ssNotFoundException byte classBytes = null; try classBytes = loadClassBytes(name); ,26,编写你自己的类加载器,catch (IOException e) throw new ClassNotFoundException(name); Class cl = defineClass(name, classBytes, 0, classBytes.length); if (cl = null) throw new ClassNotFoundException(name); return cl; /* Loads a
21、nd decrypt the class file bytes. param name the class name return an array with the class file bytes */ private byte loadClassBytes(String name) throws IOException ,27,编写你自己的类加载器,String cname = name.replace(., /) + “.caesar“; FileInputStream in = null; in = new FileInputStream(cname); try ByteArrayO
22、utputStream buffer = new ByteArrayOutputStream(); int ch; while (ch = in.read() != -1) byte b = (byte) (ch - key); buffer.write(b); in.close(); return buffer.toByteArray(); finally in.close(); ,28,编写你自己的类加载器,private int key; 我们的Caesar密码版本使用的密钥是从1255之间的一个数字,解密时,只需将密钥与每个字节相加,然后对256取余。Caesar.java程序就实现了
23、这种加密行为。 为了不与通常的类加载器相混淆,我们对加密的类文件使用了不同的扩展名.caesar。 解密时,类加载器只需要将每个字节减去该密钥即可。,29,编写你自己的类加载器,import java.io.*; /* Encrypts a file using the Caesar cipher. */ public class Caesar public static void main(String args) if (args.length != 3) System.out.println(“USAGE: java Caesar in out key“); return; try Fi
24、leInputStream in = new FileInputStream(args0); FileOutputStream out = new FileOutputStream(args1); int key = Integer.parseInt(args2);,30,编写你自己的类加载器,int ch; while (ch = in.read() != -1) byte c = (byte)(ch + key); out.write(c); in.close(); out.close(); catch (IOException exception) exception.printStac
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 企业级 应用 系统 体系 架构 简介
链接地址:https://www.31doc.com/p-2591570.html