Topic: 高手请指教这类题的编程思想

  Print this page

1.高手请指教这类题的编程思想 Copy to clipboard
Posted by: dfdsp01
Posted on: 2005-06-05 17:40

有个文件存储用户的信息,文件名:passwd
文件存储格式:username:userID:GroupID:home-dir
每个用户的信息占一行
每个用户属于不同的组,文件名:group
格式:groupname:GroupID:user-list
a.一个用户可以属于不同的组,一个组也可以包含多了用户,现在建立一个用户管理系统,尽量采用JavaBean的方式建立User和Group,除了包含以上提供的信息外,还要反映出两个类型之间的关系,同时这两个类型的对象能在网络上传输.
b.创建类型DataBuilder,通过解析字符串(passwd和group文件中的串)创建User和Group对象
c.创建类型FileAnalyzer,读取文件passwd和group的内容,使用DataBuilder,打印到屏幕上.
d.编写一个Socket的Client,将步骤c中产生的用户和组对象传到Server上
e.编写一个Socket的多线程服务器程序UserServer,接收Client发送的对象,并输出到屏幕上.

就是这个题目,请教各位,像这类题,2个类之间的关系应该怎么建立?思路是什么?主要想了解这类题的编程思想,和关系的建立?各位,请了..........

2.Re:高手请指教这类题的编程思想 [Re: dfdsp01] Copy to clipboard
Posted by: jigsaw
Posted on: 2005-06-07 17:41

我感觉这题。。。。风格还真像scjd。。。

3.Re:高手请指教这类题的编程思想 [Re: dfdsp01] Copy to clipboard
Posted by: dfdsp01
Posted on: 2005-06-07 21:50

???
什么意思???

4.Re:高手请指教这类题的编程思想 [Re: dfdsp01] Copy to clipboard
Posted by: ranchgirl
Posted on: 2005-06-29 12:05

Sun Certified Java Developer (SCJD)

5.Re:高手请指教这类题的编程思想 [Re: dfdsp01] Copy to clipboard
Posted by: wonderfuture
Posted on: 2005-09-01 15:51

Group对象中应包含一个成员,用来代表Users(User集),具体方案很多。这就是个数据结构设计的问题

6.Re:高手请指教这类题的编程思想 [Re: dfdsp01] Copy to clipboard
Posted by: ftang
Posted on: 2005-09-13 22:42

Group and User Object are typical Value Objects(VO). VO means these type of objects used to carry the data but without operation( the operation on Group and User objects is designed in DataBuilder object).

The relationship between the Group and User object is:
Group object HAS a List of User object.
User object HAS a attribute called GroupID.

d.编写一个Socket的Client,将步骤c中产生的用户和组对象传到Server上
This is a little bit tricky, from what u said, I think u need more detail to figure out what object(s) u really need to send to server.


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923