The project development process and problems? _ Home Emergency Delivery Project

Source: Internet
Author: User
Tags documentation locale serialization log4j
I. Requirements and documentation
1. Project type
OA: Office automation (office automation, referred to as OA) is a modern office and computer network functions combined with a new type of office way
CRM:CRM (Customer relationship Management) CRM, which is commonly referred to as client relationship management, refers to software systems that automate the analysis of sales, marketing, customer service, and application support processes using computer automation.
ERP:ERP is the abbreviation of Enterprise Resource Planning (Enterprise resource plan), ERP is the enterprise management software integrating integration of material resource management (logistics), human resource management (flow), financial resource management (wealth flow), information resource management (flow).
CMS: Site Content Management system, that is, Management systems, English abbreviation is CMS. The website content Management system has many excellent template-based design, which can speed up the development of the website and reduce the cost of development.

The physical system is the ERP subsystem

2, the project related introduction
Research and development time phase No. 20102 project, using CS architecture
For two-phase system requirements, using B/S production

Scale: More than 20 engineers, less than 3 months (enterprise usually "person month" concept calculates project scale-----60 person month)-------3.004 billion projects

3. Project documents:
Project experience: Project requirements, how to achieve
Documentation: Home delivery New Business System process specification-consolidated version. doc

Software development process: Home rush to the company open tender (Kingdee, Ufida)-----After the successful establishment of the project team (project manager, demand Analysis engineers, developers page design engineers, art, Java Engineers, test engineers)-------needs of people to organize the needs
* * Documents: Home urgent delivery of new BOS system software Requirements specification. Doc-----(Job: Read Introduction before System Management Section)

Java engineers, access to the highest documents usually required documents-------------system prototypes (fake data pages), detailed design, development code

4, the function is divided into three modules: Public information module, access to the school (business admissibility, cargo scheduling, return goods), transit business (goods in and out of the warehouse), routing management (transport tools, access to port)

====================================================================================
Second, technology selection
Junior Engineer, post-entry system maintenance upgrade (based on original system function append)

Small company project Manager ===== Project Manager + Technical Manager + Architect

Large companies
Project Manager: Manage projects (human, financial, project progress, and customer communication bias Sales)----0 Technology (team management)
Architect: Technology selection, problem solving, guarantee technical solution can be implemented in project team (technical management)
Technical Manager (team Leader): Work with your men to make sure that the people in your job are done.

Technology selection:
Project three-tier architecture: Web-tier solutions, business-tier solutions, data-tier solutions
Any company: long-term development, accumulation of custom components

Process technology: Struts2 + spring3 + hibernate3
Running platform: Version management SVN + Linux (Server environment Deployment) + tomcat7.0 + JDK7 + Oracle
Development environment: Window + tomcat7.0 + JDK7 + mysql

UI design: jquery Easy UI
Server Side: Task Scheduler (timer) quartz, form HTML online editor (WYSIWYG), report Open Flash Chart, JBPM, Excel parsing POI

Third, technology preheating stage
1, struts2 + Spring3 + Hibernate
Convenience: Development of preferred annotations
Proficiency: Configuration file

The STRUTS2 framework uses all jar packages, Struts2-spring-plugin.jar, (annotations Struts2-convetion-plugin.jar) in Blank.war
Non-annotated Web.xml struts.xml
Annotation Web.xml @Action

Create a separate source folder-----------config for better maintenance of location files in actual development
In actual development, a single test is often required, separating the test code from the functional code, or by creating a separate source Forlder-------------test

The SPRING3 framework uses core, AOP, TX, JDBC, DAO, test, Web, log
* * Import log4j.properties under Config
* * Create applicationcontext.xml jdbc.properties under Config
* * Hibernate entity classes are developed with annotations
Configure data sources, Hibernate entity classes through Packagetoscan automatic scanning, transaction manager TransactionManager, using annotations to manage transactions

Configure Web.xml Contextloaderlistener

The hibernate framework uses Hibernate3.jar, Required/*.jar, Jpa.jar, log4j, level two caching
Write hibernate configuration to spring ApplicationContext

Problem: Struts2 is directly interacting with the client, you need to write JSP file, how to do permissions control JSP.
* Scheme one: If the JSP under Webroot, URL directly access to, through the filter to control the rights
* Scheme II: The JSP into the Web-inf, the page URL can not be directly accessed through the STRUTS2 action to the JSP (because after action, through the interceptor to control the rights)
Using scenario two, the action does not have any logic, but simply jumps-------the default processing class
<default-class-ref class= "Com.opensymphony.xwork2.ActionSupport"/>

<action name= "page_*" >
<result>/WEB-INF/pages/{1}.jsp</result>
</action>

Problem: The client uses Ajax to access struts2, struts2 How to return a JSON data
* Programme one: Json-lib
* Programme II: Flexjson

Ajax process, please use Firefox to view the communication process data, debugging JS----Firebug often use console.info (information); (similar to System.out)

Json-lib
Todo:json-lib serialized Date Object appears exception
If two objects are related to each other, in the serialization process, Net.sf.json.JSONException:There is a cycle in the hierarchy! ----Resolve Jsonconfig set a property not to be serialized

Flexjson
Import Flexjson.jar
Jsonserializer Jsonserializer = new Jsonserializer ();
String result = jsonserializer.serialize (customers); ------The current object is serialized by default, and the association order is not serialized
String result = jsonserializer.deepserialize (customers); ------depth serialization, serialization of associated objects

Jsonserializer.exclude ("*.class"); No serialization of the GetClass property
* * No date problem

Problem: Transaction management at the business level.
Using hibernate, inject the Sessionfactory object into the Hibernatetransactionmanager with the object for transaction control
<tx:annotation-driven transaction-manager= "TransactionManager"/> Use annotations to manage transactions-------in the need to manage transaction classes or methods @ Transactional
Perform transaction management usually service layer

Transaction Management @Transactional Properties Isolation isolation Level propagation propagation Behavior read-only setting transaction read-only timeout setting transaction timeout

Problem: Usually the lock writing code is tested against the business layer
@RunWith (Springjunit4loaderrunner.class)
@ContextConfiguration ("Location:classpath:applicationContext.xml")
Public Xxxservicetest {
@Autowired
Private Xxxservice Xxxservice;

@Test
public void Testregist () {
}
}

Question: Whether to use interfaces when architecting the system.
In the business layer, the data layer will be defined interface, unified specification, tiered development
* Many outsourced companies, divided by the level of tasks
* Development process, the action relies on service, service dependent DAO, using the interface for tiered development, such as: the Web layer only need to invoke interface programming, business layer only to consider interface implementation
* Easy to maintain

Problem: The data tier, which will be manipulated using hibernatetemplate. Many of the methods provided by the template use generics
For example:
Saves a data object to the database This.gethibernatetemplate (). Save (object); ------can be used to save a variety of data types
Modify Update ()
Remove Delete
Query Get/load According to the ID query, query all find, conditional query Findbycriteria

Will repeat the operation to extract a public class Genericdao<t> extends Hibernatedaosupport
The difference between an interface and an abstract class ...
Increase
public void Save (T obj);
Delete
public void Delete (T obj);
Modify
public void update (T obj);
Inquire
Public T FindByID (class<t> domainclass, Serializable ID); If the ID is self increasing, it is defined as Integer or Long
Public list<t> findall (); Query all
Public list<t> Findbycriteria (Detachedcriteria criteria);//Various conditions query, add sort
Public list<t> Findbycriteria (detachedcriteria criteria, int firstresult, int maxresults); Page-Search
Public list<t> findbynamedquery (String namedquery); Make conditional query, use HQL, call Namedquery name on business layer

Use annotations to configure customer and order
@Table (name= "orders")
public class Order {
@Id
@GenericGenerator (name= "Uuidgenerator", strategy= "UUID")
@GeneratedValue (generator = "Uuidgenerator")
Private String ID;
Private String addr;
@ManyToOne (Targetentity=customer.class)
@JoinColumn (name= "customer_id")
Private customer customer;

@Entity
@Table (name= "Cutomers")
public class Customer {
@Id
@GeneratedValue (Strategy=generationtype.auto)
Private Integer ID;
private String name;
Mappedby equivalent to inverse, the foreign key rights to each other
@OneToMany (targetentity=order.class,mappedby= "Customer")
Private set<order> orders = new hashset<order> ();

====================================================================================
Iv. Construction of BOS Project
Divided into three resource bundles: src source code, config profile, test case
Consolidation: Configure action to Struts.xml, applicationcontext.xml main configuration business tier and data tier, data source, transaction management------divide applicationcontext.xml into service, DAO

When writing code: Configure struts Action configuration Struts.xml, configure service to Service.xml to configure DAO to Dao.xml

Action, service, DAO are all using XML configuration, entity class domain use annotation (omit hbm file)
* Allow injection, use autowired annotation (use autowired need <context:annotation-config/>)

Client Front page-------------------------using the jquery Easyui front-end framework
Why do you use Easyui? Many teams, engineers are mainly server-side engineers, not familiar with page development-------CSS is poor
* * Many front-end UI frameworks, with CSS templates, even Java engineers can write very beautiful interface

Why not ExtJS. You want to use Easyui?
Because the EXTJS framework is relatively large, introduced, system performance problems, relatively slow, Easyui lightweight JS Front-End framework

Do you know Easyui charge?
1.2.2 version prior to using the GPLV3 protocol, open source organization Agreement-----FREE
1.2.3 after the GPL License commercial License

Use the version 1.3.2---------to download the version Easyui (a jquery-based front-end UI framework that works quickly to build the front-end interface)
Files that need to be imported into the project:
1. Locale Internationalization information file
2, plugin all plug-in JS files
3, Theme Theme CSS
4. Jquery-1.8.0.min.js jquery Core Pack
5, Jquery.easyui.min.js all plug-ins of the collection = = Plugins all JS
6, Easyloader.js can be based on the code to choose plugin Plug-ins

Easyloader.js + Plugin = = Jquery.easyui.min.js
Learning curve: Layout layout

<script type= "Text/javascript"
src= "${pagecontext.request.contextpath}/js/jquery-1.8.0.min.js" ></script>------------jquery Core JS
<script type= "Text/javascript"
src= "${pagecontext.request.contextpath}/js/easyui/jquery.easyui.min.js" ></script>--------Easyui Core JS
<script type= "Text/javascript"
src= "${pagecontext.request.contextpath}/js/easyui/locale/easyui-lang-zh_cn.js" ></script>-----Internationalization Information
<link id= "Easyuitheme" rel= "stylesheet" type= "Text/css"
href= "${pagecontext.request.contextpath}/js/easyui/themes/default/easyui.css" >------Easyui Core CSS
<link rel= "stylesheet" type= "Text/css"
href= "${pagecontext.request.contextpath}/js/easyui/themes/icon.css" >--------icon CSS

The first kind of page code uses HTML to write, uses the Easyui to render, the second uses the JS to generate the page HTML

Layout layout divided into East and west-----is necessary, both East and West can be omitted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.