Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
COMP5028 Object Oriented Analysis and Design  Semester 1, 2007 
1 of 1 
 
 
Laboratory Session Nine 
SIT 116/117 
Wednesday May 23,2007 
School of Information Technologies 
The University of Sydney 
Design Pattern Practice III 
PROBLEM DESCRIPTION 
 
A file system basically consists of directories and files in a tree structure. Files may be of 
many different types: text files, executables, java source files, etc. In this exercise, 
however, we restrict the discussion to three types: binary, plain text, and java source.  
 
We need to realise an extensible file system browser that allows arbitrary operations to be 
performed on an arbitrary (sub) trees of the file system. For instance the size operation 
must report the total size of all files rooted in some directory (summing the size of all 
files in the transitive closure rooted in the given directory); a copy operation allows a 
directory tree to be copied; a convert operation allows all text files to be converted 
between UNIX and Windows text formats; a javac operation compiles all java source 
code files to be compiled to a separate byte code directory having the same directory 
structure; etc. The browser must be extensible meaning that users can plug-in new 
operations after the system is deployed. (Ideally at run-time but let us say that we just 
require that no source code changes must be introduced into the browser when adding 
operations.)  
TASKS 
1. Find a suitable pattern(s) to represent the file system, and describe the mapping 
from the pattern description(s) onto the file system domain using a class diagram. 
Answer the following questions: 
 
2. Identify a behavioural design pattern that allows us to design an extensible file 
system browser. Describe the structure using UML Class diagram.