当前位置:首页 > 心里咨询系统的设计与分析
5.2 系统结构设计
系统的概要设计中最重要的就是系统的模块化。模块化是指解决一个复杂问题时自项向下逐层把软件系统划分成若干个模块的过程。每个模块完成一个特定的功能,所有的模块按某种方法组织起来,成为一个整体,完成整个系统所要求的功能。
将系统划分为多个模块是为了降低软件系统的复杂性,提高可读性、可维护性,但模块的划分不能是任意的,应尽量保持其独立性。也就是说,每个模块只完成系统要求的独立的子功能,并且与其他模块的联系最少且接口简单,即尽量做到高内聚低耦合,提高模块的独立性,为设计高质量的软件结构奠定基础。
在系统的概要设计中采用结构化设计以需求分析阶段产生的数据流图为基础,按一定的步骤映射成软件结构。首先将整个系统化分为几个小问题,小模块。然后,进一步细分模块,添加细节。
5.3 详细设计
5.3.1 管理员登录界面
对于一个完整的心理健康网,不仅要求功能强大、操作简单,还要有良好的设计风格和另人爽目的界面。登录界面对于整个系统来说是非常重要的,因为它设置了进入本系统的用户和口令,防止非法用户进入系统,破坏系统安全和所保存的数据,只有合法的管理员在输入正确的密码后方可进入系统,否则将提示密码或用户名输入错误,并询问用户是否重新输入。这样就对使用者有了限制,增加了系统的安全性和保密性,便于控制和管理,有利于系统的维护。
5.3.2 心理健康信息管理
心理健康信息管理模块是本系统中一个基础的部分,在本模块中包括对心理健康信息信息的增删改功能,确保资料的安全。增加了系统的安全性和保密性,便于控制和管理。
5.3.3 心理测试模块
本模块主要实现检索文字套红显示等操作。如下图所示:
5.3.4 心理咨询模块
本模块主要实现对心理咨询信息的管理功能,包括:增加、删除、修改、浏览操作。例如,会员需要咨询一些关于自身的问题,可以给后台管理进行留言,如下图:
而后台管理员在收到需要相关咨询,会在后台进行回复,如下图:
增加留言的相关代码如下:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request,response); }
/**
* The doPost method of the servlet.
*
* This method is called when a form has its tag value method equals to post. *
* @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding(Constant.CHARACTERENCODING); response.setContentType(Constant.CONTENTTYPE); //nikename, pic, email, qq, weburl, blogurl, expressions, content String sysdir = new SystemBean().getDir(); HttpSession session = request.getSession();
String method = request.getParameter(\ GuestBookBean guestBookBean = new GuestBookBean(); if(method.equals(\发表留言
String member=(String)session.getAttribute(\ String nikename =
Filter.escapeHTMLTags(request.getParameter(\ String face =\ String email =
Filter.escapeHTMLTags(request.getParameter(\ String qq =
Filter.escapeHTMLTags(request.getParameter(\ String weburl =
Filter.escapeHTMLTags(request.getParameter(\ String blogurl =
Filter.escapeHTMLTags(request.getParameter(\ String expressions =
\m())+\
String content =
Filter.escapeHTMLTags(request.getParameter(\ String ip = request.getRemoteAddr();
int guestbook=1;
int flag = guestBookBean.addGuestBook(nikename, face, email, qq, weburl, blogurl, expressions, content, ip,guestbook); if(flag == 1){
request.setAttribute(\\谢谢您的留言,请等候管理员回复!\
回复留言相关代码如下: String messageid =
Filter.escapeHTMLTags(request.getParameter(\
共分享92篇相关文档