Elements of Application Design – Key Considerations
•Availability and Reliability
–Availability
•A system's accessibility during daily operations, or the ability of a system to perform its functions at any given instant under certain conditions.
–Reliability
•The average length of time an application runs without failure. It is also about providing the expected results, consistently, without unexpected surprises, failures or errors.
•Performance
–The response time of the system for a user request.
大数据量的时候,PreparedStatement+batch
PreparedStatement stmt = conn.prepareStatement("INSERT INTO Userinfo(username,password) VALUES(?,?)");
User[ ] users = addUser();//取得 要插入的数据的数组
for(int i=0; i<users.length;i++){
stmt.setString(1, users[i].getUsername());
stmt.setString(2, users[i].getPassword());
stmt.addBatch( );
}
int[ ] counts = stmt.executeBatch();
•Scalability
–Attribute of a software system that characterizes the degree to which an application can support an increase in processing volume or in number of users.
•Maintainability
–The ability to perform preventive and remedial maintenance activities on the infrastructure.
•Security
–The ability of the system to resist unauthorized attempts to access the system and denial-of-service attacks while still providing services to authorized users.
•Operability
–The ability of an architecture to allow routine support activities (for example, backups, event monitoring, batch scheduling) to be undertaken without any disruption to the live service.
•Deliverables from the Analysis and Design Phases:
–Class Diagram
–Created in the Analysis Phase to provide an overview of the classes identified and their relationships. Updated in the Design Phase to reflect any new classes and relationships found.
Defining class specifications involves:
Defining class visibility
Defining operations
Defining attributes
Representing relationships
Interaction Diagrams, ex:–Sequence Diagrams (focus on order of interaction)
–State Diagrams
–Activity Diagrams
–Class Definition
–Component Diagram
–
•Design Principles include:
–Open Close Principle (OCP)
–Dependency Inversion Principle (DIP)
–Liskov Substitution Principle (LSP)
–Single Responsibility Principle (SRP)
–Interface Segregation Principle (ISP)
–Law of Demeter (LoD), or Principle of Least Knowledge
•Characteristics of Design Patterns:
–Reusable solutions to recurring problems.
–Distilled from the experiences of experts.
–Repeats a successful design done by someone else.
–Provides us with a vocabulary to describe and discuss a particular design.
–Designers can recognise a problem to which specific patterns apply and immediately determine the solution without having to stop to analyse the problem first.
•Guidelines while using Design Patterns:
–Do not try throwing patterns into design.
–Do not try to use all the patterns.
–Keep the design simple and do not add unnecessary levels of indirection.
•Key considerations in class design:
1State Management: This is the mechanism used to maintain state of an object.
2Data validation: Ensures that data is validated prior to applying business rules and/or persisted in the repository.
3Exception handling: A mechanism for dealing with errors and failures of the application.
4Transaction management: Coordinates transactions across one or more resource managers within a network, and ensures that all resources for a transaction are updated, or in the case of an update failure on any one resource, all updates are rolled back.
5Logging and Audit Tracing Services: Permanently store application information in a data store that can be later accessed for operations management.
6Multi-Threading and Thread Safety:
Multi-threading enables different parts of a program to be executed by different threads.
Thread safety means that the code functions properly when executed simultaneously by multiple threads.
7Marshalling and Serialization:
Marshalling: The process of breaking the object into a form that can be sent over the network.
Serialization: The process of breaking the object into a sequence of bytes.
8Security: Security Services play a vital role in applications and are a part of a majority of application requirements.
1 State Management
Categorize classes into stateful and stateless.
Business classes, service classes, and data store classes are generally stateless.
Decide how the state information is to be maintained
Memory
Database
Objects on disk
Java Persistence API
Hibernate
2Data Validation
Data validation takes place in the following places:
Client Browser
Presentation Layer
Business Layer
Data Access Layer
There are two types of validation that can be performed on data provided by the user:
Shallow validation is a simple algorithmic validation or data validation that can be performed without reference to large business data sets.
Examples of shallow validation include:
Checking that mandatory data fields do not contain null or empty values.
Range checking for minimum and maximum values.
Checking the format of data such as postcodes, sort codes, etc.
Simple algorithmic checks. An example of a simple algorithmic calculation would be the determination of whether a particular day is a working day. Determining non-weekend days is easy using modulus maths from a seed date, but public holidays are more easily determined using a small dataset containing the public holidays for a given year. Eight public holiday dates for each year would be an example of a small dataset if the validation is not done over too long a timeframe!
The designer must determine which shallow validation needs to be performed in the UI and decide whether it should be client-side or server-side or both. Shallow validation is typically done in the UI layer, before the data is passed to the business layer. Validations may be duplicated in the business layer depending on where the same data is passed to the business layer apart from the UI layer.
Deep validation is a more complex algorithmic validation or data validation that requires large business data sets to successfully complete the validation. An example of deep validation is ensuring that a number such as “99999” represents a real zip code rather than just looking like one.
Guideline:
During design, keep track of all validations to be done as well as the layer/component in which they would need to be taken care of.
In summary, apart from validating user input in the UI layer, validations are also done in the business layer. These are typically business validations. Different methods may be used for validating data, such as having rules engines or utility classes, or having them in the business components.
3Exception Handling
Exception: A mechanism for dealing with errors
Causes of exceptions:
Programming errors
Resource failures
Functional errors
Interface/Third Party errors
Exception handling:
Restores an application to a known state
Takes appropriate corrective action
Guidelines for exception handling
4Transaction Management
Transaction Management involves:
Coordinating transactions
Ensuring all resources involved in a transaction are updated
Ensuring all updates are rolled back in case of failure
Transactions are typically initiated at the business layer as they may span multiple resources and/or entities.
5Multithreading and Thread Safety
Multi-Threading: Allowing different parts of a program to be executed by different threads.
Benefits
Improves responsiveness
Improves throughput
Disadvantages
Deadlocks
Race Conditions
Shared resources: Operations must access one-at-a-time.
Sequence of operation: Operations may be required to access a shared resource in a particular order.
6Logging and Audit Tracing
Logging and audit tracing services permanently store application information in a data store that can be later accessed for operations management.
Typically, logging and audit tracing services are used to:
Keep track of technical failures.
Monitor the load of a server or the use of an application.
Document the use of sensitive application or system privileges, such as creating new users.
Store transaction and digital signature data for non-repudiation purposes.
Design Decisions
Know the logging and audit tracing requirements of the system
Understand their later usage
Select an approach to implement logging or audit tracing mechanism
Concerns
Decisions regarding the log
File size and its maintenance
Archival frequency
Guidelines
Record application specific messages
Actively monitor and fix errors in logs
Optimize logging settings
Keep file size manageable
7Marshalling and Serialization
Scenarios for marshalling/serialization
Transferring an object over the network in distributed environments.
State maintenance, by storing the sequence of bytes in a file or database
8 Security
Application security includes the following components:
Authentication: Verifying that someone is who they claim they are.
Authorization: Finding out if the person, once authenticated, is permitted to have the resource.
Access Control: Controlling access to a web resource.
Encryption: Providing confidentiality of information, both while in transit and in storage
Elements of Application Design – Architecture Layers
Presentation Layer
UI Layer
UI Controller
Business Logic Layer
Data Access Layer
The main responsibility of a data access layer is to insulate the business logic layer from the technical specifics of how the information is stored and accessed.
The data access layer typically does the following:
Maps data between the business data structure to the physical data structure.
Manages input/output (I/O) operations with the data store.
Makes any data-type conversions as needed depending on the data store being used.
Handles data access/retrieval-related errors.
The data access layer should contain a minimum amount of processing logic (nothing more than the functions listed on this page).
Key considerations used in creation of page specifications:
Data binding
Validation
State Management
Data propagation across screens
Exception handling
Localization and Internationalization
Security
Caching
Browser dependency
发表评论
-
面试常见问题
2010-09-07 11:19 01 自我介绍, 面试前了解面试的内容,做到有的放矢。 你好 ... -
租房 ~~~~
2010-08-16 17:14 0科技园48区, 精英公寓 ... -
系统化交易
2010-08-02 11:50 0假设85%的价格总是围绕 ... -
todo List
2010-07-15 14:35 0广州: 1 现实表现鉴定,done ... -
Team Management
2010-02-09 16:04 565品质: 1 榜样, 赢得下属的尊敬。 2 专家 3 正直 ... -
有目的的演讲
2010-01-25 11:06 818例子:你的公司开发出某新产品,你要给一群目标客户做一次讲座,介 ... -
在Excel中自动从网上获取中证流通和基金指数
2009-12-31 19:43 1426Uri = "http://hq.sinajs.cn ... -
Tidy
2009-12-30 16:17 1583自己写的一个程序需要从网页抓取数据,思路是将网页转换成XML ... -
JavaTM Web Start 技术
2009-12-16 09:50 883http://java.sun.com/javase/tech ... -
Derby
2009-12-04 11:41 11991 嵌入式模式和服务器模式 嵌入式模式:只允许一个applic ... -
JAVA WEB 系统设计开发知识体系
2009-12-04 09:46 15491.1 Browser 1.1.1 HTML 1.1.2 CS ...
相关推荐
App Architecture: iOS Application Design Patterns in Swift 包含Source code 有钱请支持正版 没钱请默默学习 原书地址: https://www.objc.io/books/app-architecture 中文原书地址: ...
JavaScript Application Design 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传...
JavaScript Application Design: A Build First Approach introduces techniques to improve software quality and development workflow. You'll begin by learning how to establish processes designed to ...
Qualities of a great application 8 How Do You Design the Obvious? 10 Turn qualities into goals 10 The Framework for Obvious Design 12 Know what to build 14 Know what makes it great 14 Know the ...
Title: JavaScript Application Design: A Build First Approach Author: Nicolas Bevacqua Length: 344 pages Edition: 1 Language: English Publisher: Manning Publications Publication Date: 2015-02-16 ISBN-...
本章《Application Design and Development》主要探讨了如何构建高效、安全的数据库应用程序。 首先,大部分数据库用户并不直接使用SQL这样的查询语言。用户通常通过形式化的界面、图形化用户界面(GUI)、报告生成...
《App Architecture: iOS Application Design Patterns in Swift 中文版》这本书聚焦于iOS应用程序的架构设计,即如何将较小的部分组合成一个完整的应用。在本书中,作者们探讨了多种设计模式,旨在帮助开发者更好地...
Microsoft Dynamics CRM 2015 Application Design_Code.zip
Uwe Thiem的《KDE Application Development》(ISBN号:1-57870-201-1)关注于使用KDE框架进行应用程序开发,同样为Web应用设计中的用户界面和交互设计提供了思路。 通过上述书籍的知识点整合,我们可以看出,Web...
《CUDA应用设计与开发》是2011年由NVIDIA公司和Rob Farber共同出版的一本专业书籍,由Morgan Kaufmann出版社发行,该出版社是Elsevier的一个分支。本书主要聚焦于CUDA(Compute Unified Device Architecture)的应用...
比较深度的讲解如何设计专业的web应用程序,适合资深的网站开发者。尚在学习阶段的开发者不要下,免得浪费积分。
比较深度的讲解如何设计专业的web应用程序,适合资深的网站开发者。尚在学习阶段的开发者不要下,免得浪费积分。
《Microsoft Dynamics CRM 2015 应用设计与编码实践》 Microsoft Dynamics CRM 2015 是一款强大的客户关系管理系统,它为企业提供了一整套解决方案,用于管理与客户和潜在客户的互动,提高销售效率,优化客户服务,...