Discussion Board
Go to the previous messageThere are no next messages
Current Forum: Homework 5 - Parts 1 and 2
Date: Thu Nov 15 2001 3:02 pm
Author: Scherer, Sebastian <basti@cmu.edu>
Subject: Re: toString() in WebIndex.java

Hi,
From a oo-point of view it is much better to use ObjectOutputStream/ObjectInputStream to write out the index. It is maybe two lines but nicer.(As long as you every object is implemented as serializable)

For example:

ObjectOutputStream p = new ObjectOutputStream(stream);
p.writeObject(trieRoot);

I think there is a minor mistake in the implementation of WebCrawler. The Stream should be flushed and closed at the end of the use, but it is not done. It is bad style to do this in a subroutine, because it is not known if the Stream should be closed or is used further.

Sebastian
Post response

Go to the previous messageThere are no next messages
Current Thread Detail:
toString() in WebIndex.java      Chen, Richard      Sat Nov 10 2001 4:57 pm       
Re: toString() in WebIndex.java      Goodman, Brian J.      Sat Nov 10 2001 5:04 pm       
Re: toString() in WebIndex.java      Chen, Richard      Mon Nov 12 2001 4:32 pm       
Re: toString() in WebIndex.java      Goodman, Brian J.      Mon Nov 12 2001 5:43 pm       
Re: toString() in WebIndex.java      Scherer, Sebastian      Thu Nov 15 2001 3:02 pm       

Back to previous screen