搜档网
当前位置:搜档网 › 《回家的路》软件设计说明书_Darkking_贺杨杰

《回家的路》软件设计说明书_Darkking_贺杨杰

《回家的路》软件设计说明书_Darkking_贺杨杰
《回家的路》软件设计说明书_Darkking_贺杨杰

《回家的路》设计说明书

第一章引言

1.1 概述

《回家的路》系统设计说明书的目的在于从设计的角度明确《回家的路》的业务品种、功能范围,明确与业务主机/终端系统的接口和业务处理模式,使系统开发人员和产品管理人员明确产品功能,可以有针对性的进行系统开发、测试、验收等各方面的工作。

1.2 背景

系统名称:《回家的路》

组织:

涉众:

老大:

开发者:Darkking

1.3 定义

1.4 参考资料

《《回家的路》用户调研及业务建模》。

《《回家的路》需求与分析说明书》。

1.5 术语与缩写解释

2. 系统架构

使用图和文字将系统的架构说明清楚,主要内容包括功能之间的关系。

系统架构图.

3. 《回家的路》设计说明

3.1订票设计

3.1.1类图

3.1.2 实现类设计

1.DemandCon类设计

1)属性说明

无。

2)方法设计

/**查询车票 */

publicvoid query() {

// TODO: implement

//1.请求查询车票

//2.查询车票

//3.接收查询结果

//4a.显示查询的车票

//4b.显示查询失败界面

}

/**预订车票*/

publicvoid bookingTickets() {

// TODO: implement

//1.请求确认订票

//2.订票

//3.返回订票结果

//4.把订票单存入数据库

}

2.Tickets类设计

1)属性说明

departure:出发地,destination:目的地,trainnumber:车次,ridingtime:乘客时间,ticketprice:票价。

2)方法设计

//验证查询信息

publicboolean query(String departure,Stringdestination,String year,

String month,String day) {

// TODO: implement

//1.得到需要验证的信息

//2.验证信息

//3a.返回失败结果

//3b.返回成功结果

//验证车票

publicboolean bookingTickets(String departure) {

// TODO: implement

//1.得到车票数据

//2.验证数据

//3.返回结果

3.MainView类设计

1)属性说明

EditText:departure:选择出发地。destination:选择目的地。year、month和day:乘车日期Button:query:请求查询车票(跳转到查询界面)。(meal:请求改签。refund:请求退票)2)方法设计

无。

4.TicketsView类设计

1)属性说明

TextView:departuretv:显示车票出发地。destinationtv:显示车票目的地。yeartv、monthtv、daytv:显示车票日期。

ListView:listview:用来显示查询到的车票信息,包括车次,出发地、目的地、时间和票价2)方法设计

无。

5.PayView类设计

1)属性说明

EditText:name:输入乘客姓名。id:输入乘客身份证号

Button:paynow:立即支付(跳转到支付成功界面)。

2)方法设计

无。

6.PSview类设计

1)属性说明

Button:back:返回主界面。

2)方法设计

无。

3.1.3.顺序图

3.1.4界面设计

3.2.1类图

3.2.2 实现类设计

1.DemandCon设计

1)属性说明

无。

2)方法设计

/**改签*/

publicboolean queryTOT() {

//1.请求改签

//2.改签

//3.删除将要改签的订票单

//4.显示当日的车票信息

//5.选择车票

//6.将订票单存入到数据库

//7.返回改签结果

}

1.Tickets设计

1)属性说明

departure:出发地,destination:目的地,trainnumber:车次,ridingtime:乘客时间,ticketprice:票价。

2)方法设计

//验证改签信息

public String queryTOT() {

// TODO: implement

//1.得到当日其他车次的车票时间信息

//2.返回当日其他车次的车票时间信息

}

1.BTlist设计

1)属性说明

ListView:abtickets:显示订票单信息。

2)方法设计

无。

1.MSView设计

1)属性说明

Button:Mback:返回主界面。

2)方法设计

无。

3.2.3.顺序图

3.2.4界面设计

3.3退票设计3.3.1类图

3.3.2 实现类设计

1.channel设计

1)属性说明

2)方法设计

3.3.3.顺序图

3.3.4界面设计

4. 数据库设计

publicclass ticketsDB extends SQLiteOpenHelper{

privatestaticfinal String db = "my.db";

privatestaticfinalint vs = 1;

public ticketsDB(Context context) {

super(context, db, null, vs);

// TODO Auto-generated constructor stub }

@Override

publicvoid onCreate(SQLiteDatabase arg0) {

// TODO Auto-generated method stub

arg0.execSQL("create table ticketsdb(" +

"id integer primary key autoincrement," +

"departure text," +

"destination text," +

"Trnumber text," +

"Ritime text," +

"Tiprice text" +

"id text" +

"name text);");

}

@Override

publicvoid onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {

// TODO Auto-generated method stub

if(arg1!=arg2){

arg0.execSQL("drop table ticketsdb");

onCreate(arg0);

}

}

publicvoid insertdb(String departure,Stringdestination,StringTrnumber, String Ritime,StringTiprice,Stringid,String name) {

SQLiteDatabasesql = this.getWritableDatabase();

ContentValues cv = new ContentValues();

cv.put("departure", departure);

cv.put("destination",destination);

cv.put("Trnumber", Trnumber);

cv.put("Ritime", Ritime);

cv.put("Tiprice", Tiprice);

cv.put("id", id);

cv.put("name", name);

sql.insert("ticketsdb", "departure = ?,destination = ?,Trnumber = ?,Ritime = ?,Tiprice = ?,id = ?,name = ?", cv);

}

//查找数据

public Cursor search(){

SQLiteDatabasesql = this.getReadableDatabase();

Cursor c = sql.query("ticketsdb", null, null, null, null, null, null);

return c;

}

}

4.1 CDM图

4.2 PDM图

4.3 数据库脚本

/*==============================================================*/ /* DBMS name: Sybase SQL Anywhere 11 */

/* Created on: 2015/8/25 19:17:00 */

/*==============================================================*/

if exists(select 1 from sys.sysforeignkey where role='FK_关联_关联_PASSENGE') then alter table 关联

delete foreign key FK_关联_关联_PASSENGE

end if;

if exists(select 1 from sys.sysforeignkey where role='FK_关联_关联2_TICKETS') then alter table 关联

delete foreign key FK_关联_关联2_TICKETS

end if;

if exists(

select 1 from sys.sysindexi, sys.systable t

where i.table_id=t.table_id

and i.index_name='passenger_PK'

and t.table_name='passenger'

) then

drop index passenger.passenger_PK

end if;

if exists(

select 1 from sys.systable

where table_name='passenger'

and table_type in ('BASE', 'GBL TEMP')

) then

drop table passenger

end if;

if exists(

select 1 from sys.sysindexi, sys.systable t where i.table_id=t.table_id

and i.index_name='tickets_PK'

and t.table_name='tickets'

) then

drop index tickets.tickets_PK

end if;

if exists(

select 1 from sys.systable

where table_name='tickets'

and table_type in ('BASE', 'GBL TEMP')

) then

drop table tickets

end if;

if exists(

select 1 from sys.sysindexi, sys.systable t where i.table_id=t.table_id

and i.index_name='关联2_FK'

and t.table_name='关联'

) then

end if;

if exists(

select 1 from sys.sysindexi, sys.systable t where i.table_id=t.table_id

and i.index_name='关联_FK'

and t.table_name='关联'

) then

drop index 关联.关联_FK

end if;

if exists(

select 1 from sys.sysindexi, sys.systable t where i.table_id=t.table_id

and i.index_name='关联_PK'

and t.table_name='关联'

) then

end if;

if exists(

select 1 from sys.systable

where table_name='关联'

and table_type in ('BASE', 'GBL TEMP')

) then

drop table 关联

end if;

/*==============================================================*/ /* Table: passenger */ /*==============================================================*/ create table passenger

(

IDnumber char(18) not null,

name char(12) null,

constraint PK_PASSENGER primary key (IDnumber)

);

/*==============================================================*/ /* Index: passenger_PK */ /*==============================================================*/ create unique index passenger_PK on passenger (

IDnumber ASC

);

/*==============================================================*/ /* Table: tickets */ /*==============================================================*/ create table tickets

(

departure char(10) null,

destination char(10) null, trainnumber char(10) not null,

ridingtime char(10) null,

ticketprice char(10) null,

constraint PK_TICKETS primary key (trainnumber)

);

/*==============================================================*/ /* Index: tickets_PK */ /*==============================================================*/ create unique index tickets_PK on tickets (

trainnumber ASC

);

/*==============================================================*/ /* Table: 关联 */ /*==============================================================*/ create table 关联

(

IDnumber char(18) not null,

trainnumber char(10) not null,

constraint PK_关联 primary key clustered (IDnumber, trainnumber) );

/*==============================================================*/ /* Index: 关联_PK */ /*==============================================================*/ create unique clustered index 关联_PK on 关联 (

IDnumber ASC,

trainnumber ASC

);

/*==============================================================*/ /* Index: 关联_FK */ /*==============================================================*/ create index 关联_FK on 关联 (

IDnumber ASC

);

相关主题