<html>

<head><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- MyFirstUnitAd -->
<ins class="adsbygoogle"
     style="display:inline-block;width:970px;height:250px"
     data-ad-client="ca-pub-5778386704669218"
     data-ad-slot="1503492166"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

<meta http-equiv="Content-Language" content="en-ca">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Assignment 1 of soen423</title>
</head>

<body>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b><font color="#FF0000" size="5">Assignment 1 of soen423</font></b></p>
<p><b><font color="#FF0000" size="5"><a name="firstTry"></a>First Try</font></b></p>
<p><font color="#FF0000">1. General analysis</font></p>
<p><font color="#FF0000">1.1. &quot;startAuction&quot; </font></p>
<p>a) It is called by auction managers and auction managers can be regarded as 
special users compared with auction bidders even though from programming 
perspective they are all clients to our system.</p>
<p>b) You may need to check &quot;repeating itemNo starting&quot;. i.e. An itemNo is 
already started. At first glance you may think there is no synchronization issue 
here, but the &quot;repeating-checking&quot; is already a 
&quot;common-data-simultaneous-accessing&quot;. So, protect your 
&quot;active-bidding-table-entry&quot; with synchronization tools like Semaphore, or 
simply make &quot;checking-function&quot; synchronized.</p>
<p>c) General validity checking such as negative startBid. etc.</p>
<p><font color="#FF0000">1.2. &quot;getBid&quot;</font></p>
<p>a) It is a &quot;reading&quot; operation which has no synchronization issue here. But 
general validity checking is still there.</p>
<p><font color="#FF0000">1.3. &quot;placeBid&quot;</font></p>
<p>a) Similar validity-checking like &quot;startAuction&quot; plus &quot;bidID&quot; (whether four 
digits?) &quot;proposedBid&quot; (negative?) etc. </p>
<p>b) A &quot;writing-possible&quot; operation and definitely &quot;synchronization&quot; function 
which must be protected by &quot;critical-section&quot; with Semaphore or make it 
&quot;synchronized&quot;. </p>
<p>c) The biggest performance bottle-neck which may require fine-grained 
synchronization design. i.e. Bidding items under different auction managers are 
stored in separated table so that your synchronization mechanism doesn't lock 
the whole system for a single bidder. </p>
<p>d) Carefully choose your in-memory-storage table class so that &quot;searching 
itemNo&quot; is efficient. For example, &quot;Vector&quot; is not as good as &quot;HashTable&quot;. </p>
<p><font color="#FF0000">2. Synchronization</font></p>
<p>2.1. Synchronization is one big issue in this course and if you pay attention 
to this then you will learn almost nothing in distributed system. Here is
<a href="Synchronization.ppt">my old simple notes</a> about synchronization and 
I am pretty sure you can googled with countless examples. And there are lots of 
detailed problems discussed in my tutorial page of
<a href="comp6231_summer.html">comp6231_summer</a> (Please don't go there unless 
you are absolutely free because it is really a mess. Sorry for my laziness. ) 
However, some issues are similar and you can find <a href="commonMistakes.htm">
those common-mistakes.</a></p>
<p><font color="#FF0000">3. Testing</font></p>
<p>3.1. If in your submission there is no testing cases, I would say it is only 
half-finished because a distributed system is always error prone. </p>
<p>3.2. How to test? As instructed by professor, you must create a bunch of 
threads to run simultaneously and call all those &quot;getBid&quot; and &quot;placeBid&quot; 
functions. The parameter for them maybe generated randomly which is very good 
because it can test your validity-checking.</p>
<p><font size="5" color="#FF0000"><b><a name="secondTry"></a>Second</b></font><b><font color="#FF0000" size="5"> 
Try</font></b></p>

<p><font color="#FF0000">1. General analysis</font></p>
<p>The center of this assignment is to train you to establish synchronization 
concept. </p>
<p>a) You don't have to explicitly create &quot;thread&quot; for each function call in 
&quot;server-side&quot; because RMI will do it for you. So,</p>
<p>beware that your methods are all done in &quot;multi-threaded&quot; environment. It is 
your job to keep your classes &quot;thread-safe&quot;.</p>
<p>b) A small trick about &quot;time-to-close&quot; is that you don't have to use a 
&quot;Timer&quot; to update the closing &quot;seconds&quot; per second.</p>
<p>The simplest way is just to keep a &quot;expected-closing-time&quot; as a data member 
of your class &quot;AuctionItem&quot;.</p>
<p>c) The following is a just basic implementation in pseudo-code in case you 
feel hopeless in this assignment.</p>
<pre>
class AuctionItem
{
	public int expectedClosingTimeInSecond; //time to close in second
	public int itemNo; //six-digit-integer
	public float currentBid;//the current highest bid price
	public int bidderID;//four-digit-integer of id of bidder
}

class DAM
{
	public HashTable activeItemTable;//the table to store active auction item

	//this method should be synchronized 
	public synchronized int startAuction(...)
	{
		//validity-checking
		//first search item no in HashTable
		//if it is null, add the new item
		//return current item no.
	}

	//this method is a read-only method
	public int[] listItem(...)
	{
		//get current time in seconds
		//scan hashtable by using &quot;Enumeration&quot; from method of &quot;element()&quot;
		//check if current time is bigger than the closing moment of auction item
		//if yes, add to return array
	}	

	//this is a read-only method
	public AuctionItem getBid(...)
	{
		//get item from hashtable
	}

	//this is a write method and should be synchronized
	public synchronized boolean placeBid(...)
	{
		//validity-checking
		//get item from hash table
		//check time and bid price to decide whether to accept
		//update if possible
	}
}
</pre>
<pre><b><font color="#FF0000">2. Performance</font></b></pre>
<pre><font color="#FF0000">2.1. Is &quot;synchronized&quot; key word enough?</font></pre>
<pre>Surely it is enough for a beginner. If you are aiming for high efficiency, I would be willing to show you how deep the rabbit hole goes.</pre>
<pre><font color="#0000FF">a) First Try:</font> </pre>
<pre>Items under different auction managers don't have to be mixed together. Why don't we create a concept of &quot;AuctionManager&quot; </pre>
<pre>such that it has a list of active items? Instead of &quot;synchronize whole DAM class&quot;, we push our synchronization to a fine grain at level of </pre>
<pre>auction manager.</pre>
<pre>class AuctionManager
{
	public HashTable activeItemTable;
	public synchronized int startAuction(...){...}
	public int[] listItem(...)
	public AuctionItem getBid(...)
	public synchronized boolean placeBid(...)
}</pre>
<pre>class DAM
{
	public HashTable activeManagerTable;
		
	public synchronized int startAuction(...)
	{
		//get auctionManager from manager table
		//call acutionManager.startAuction() method
	}
	public int[] listItem(...)
	{
		//get auctionManager from manager table
		//call acutionManager.listItem() method
	}

	public AuctionItem getBid(...)
	{
		//get auctionManager from manager table
		//call acutionManager.getBid() method
	}
<b><font color="#FF0000">//Please note here we don't have to declare it as &quot;synchronized&quot; because it is done at &quot;manager-level&quot;</font></b>
	public boolean placeBid(...)
	{
		//get auctionManager from manager table
		//call acutionManager.placeBid() method
	}
}</pre>
<pre>　</pre>
<pre><font color="#0000FF">b) Is it good enough? Not necessarily!</font> </pre>
<pre>You see, different auction items are actually independent. Why should we &quot;lock-up&quot; whole items when </pre>
<pre>we only lock the perticular item? Why don't we push synchronization at level of &quot;item&quot; instead of &quot;manager-level&quot;?</pre>
<pre>class AuctionItem
{	</pre>
<pre>	public int expectedClosingTimeInSecond; //time to close in second
	public int itemNo; //six-digit-integer
	public float currentBid;//the current highest bid price
	public int bidderID;//four-digit-integer of id of bidder	
	
	public AuctionItem getBid(...)
	public synchronized boolean placeBid(...)
}</pre>
<pre>class DAM
{
	public HashTable activeItemTable;//the table to store active auction item

	//this method should be synchronized 
	public int startAuction(...)
	{
		//validity-checking
		//first search item no in HashTable
		//if it is null, add the new item
		//return current item no.
	}

	//this method is a read-only method
	public int[] listItem(...)
	{
		//get current time in seconds
		//scan hashtable by using &quot;Enumeration&quot; from method of &quot;element()&quot;
		//check if current time is bigger than the closing moment of auction item
		//if yes, add to return array
	}	

	//this is a read-only method
	public AuctionItem getBid(...)
	{
		//get item from hashtable and call item's method of getBid
	}

	<b><font color="#FF0000">//Please note here we don't have to declare it as &quot;synchronized&quot; because it is done at &quot;item-level&quot;</font></b></pre>
<pre><font color="#FF0000"><b>	//by doing this, we actually allow multiple thread to access this method to improve concurrency</b></font>	
	public boolean placeBid(...)
	{
		//get reference of item from &quot;activeItemTable</pre>
<pre>		//note here we call item's &quot;synchronized&quot; method &quot;place bid&quot; </pre>
<pre>		<b><font color="#FF0000">//call currentItem.placeBid()</font></b>		
	}
}
</pre>
<pre><font color="#0000FF">c) Which one is better? </font></pre>
<pre>In java, many programmer prefer to use the following syntax for synchronization:</pre>
<pre>	AuctionItem itemRef=(AuctionItem)activeItemTable.get(itemNo);</pre>
<pre>	<font color="#0000FF">synchronized</font>(itemRef)</pre>
<pre>	{</pre>
<pre>		itemRef.placeBid(...); //assume AuctionItem's placeBid is not &quot;synchronized&quot;</pre>
<pre>	}</pre>
<pre>But is it better than b)? I think not because by using <font color="#0000FF">&quot;synchronized</font>(itemRef)&quot; you even block those benign &quot;read-only&quot; method like &quot;getBid&quot;</pre>
<pre>if you are not properly design your code, if you plan to implement &quot;getBid&quot; also at level of &quot;item&quot;. </pre>
<pre><font color="#0000FF">d) What else? </font></pre>
<pre>Have I mentioned about &quot;thread-safe-class&quot; issues? Do I mention about how to remove those &quot;closed-items&quot;? Who should do this job? A &quot;Timer&quot;?</pre>
<pre><b><font color="#FF0000">3. </font></b><font color="#FF0000"><b>Testing</b></font></pre>
<pre><font color="#0000FF">a) Which is better? To run multiple client program in different hosts or to run a single client program which has multiple</font></pre>
<pre><font color="#0000FF">threads?</font></pre>
<pre>In this course, we are dealing with distributed computation environment and multiple accessing is so common that your testing must simulate it.</pre>
<pre>And my opinion is to write a client program with multiple threads so that they can access your server program simultaneously because it is </pre>
<pre>hard for you to press running button across multiple hosts, even with help of your classmates.</pre>
<pre><font color="#0000FF">b) Is this enough?</font></pre>
<pre>However, there is a small flaw by creating multiple threads in your client program because you have to create them one by one and run them by </pre>
<pre>calling their &quot;start&quot; method one by one. It is highly possible that they just run through your server one by one because sometimes your server</pre>
<pre>runs very fast. In other words, you don't really create a situation that multiple threads access your server simultaneously. </pre>
<pre>A small trick is to use a &quot;Class CyclicBarrier&quot; to &quot;block&quot; the created threads so that all threads run at the same time. <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CyclicBarrier.html">Check the example</a> here</pre>
<pre>in <a href="http://www.sun.com">www.sun.com</a></pre>
<pre><b><font color="#FF0000">4. Report</font></b></pre>
<pre><font color="#0000FF">a) Why is it so important? </font></pre>
<pre>Because in this course, the mark of your assignments and project has as much as 50% of your total grade. And report is half of your programming</pre>
<pre>assignment. </pre>
<pre><font color="#0000FF">b) What do you expect to write?</font></pre>
<pre>From purely software engineering perspective, your report should include the basic class diagram, design detail etc. What is more important is</pre>
<pre>that you are expected to <i><u><font color="#FF0000">write down your &quot;design choice&quot; after you give some detailed analysis.</font></u></i> For example, the correctness and performance </pre>
<pre>are the two kernel of all system and how you guarantee to achieve this goal. When , where, why, and how you make proper synchronization in your</pre>
<pre>program? When , where, why, and how do you provide your system with high performance?</pre>
<pre><font color="#0000FF">c) What else?</font></pre>
<pre>Another big issue in distributed system is that the situations are so complex that no system can guarantee to cope with all challenges. It is </pre>
<pre>up to you to write down your &quot;assumptions&quot; and &quot;limitations&quot; of your system. For example, do you expect &quot;startAcution&quot; to be called repeatedly</pre>
<pre>for the same item no even when auction bidding starts? Do you expect same bidder id to &quot;placeBid&quot; at the same time? (Is it impossible in real</pre>
<pre>life? What if Bill Gates share his ID with Mrs. Gates?) </pre>
<pre>　</pre>
<p><font size="5" color="#FF0000"><b><a name="thirdTry"></a>Third</b></font><b><font color="#FF0000" size="5"> 
Try</font></b></p>

<p><font color="#FF0000">1. Why bother?</font></p>
<p>If you are not convinced by what you can see, I think you probably will not 
spend your time to do what you are asking to do. OK, let me try to convince how 
things can go wrong with<a href="TestExample.zip"> this &quot;buggy&quot; sample program.</a> 
It is like this:</p>
<p>a) I extend our &quot;HelloWorld&quot; example with two extra method, one increase our 
price by 100, the other decrease the price by 100. I deliberately to make the 
&quot;modifying&quot; statement using &quot;more than one instruction&quot; so that it is possible 
to be broken by a context switch with another concurrent thread.</p>
<p>b) My client program now will run two groups of threads, say 50 of each. One 
group of threads try to call increase price method and the other group try to 
call decrease price method. Since the number of threads of two group are equal, 
we can expect that the starting price will be equal to ending price. i.e. When 
testing starts, my balance at server is 5000 and 50 threads increase price each 
by 100, and 50 threads decrease price each by 100. The final result should still 
be 5000.</p>
<p>c) In order to create a real concurrent situation, I use a &quot;CyclicBarrier&quot; 
which stops all threads from running until all threads are ready. Otherwise the 
threads are created one by one and started one by one, you may not be able to 
observe they run concurrently.</p>
<p>d) Compile and run the program and see what happens. You will probably get a 
different balance. Try to modify your method of &quot;incPrice&quot; and &quot;decPrice&quot; in 
HelloImpl and see if you can fix the problem.</p>
<p>e) <font color="#FF0000">If you can deliver a similar testing program in your 
A1, I will be convinced that your program is fully tested.</font></p>
<p>f) By the way, if you want to declare any method in your &quot;Interface&quot; which 
inherit from &quot;Remote&quot; interface, make sure it is declared as&nbsp; &quot;throws 
java.rmi.RemoteException;&quot;. Otherwise you may get some error.</p>
<p>　</p>
<p><font size="5" color="#FF0000"><b><a name="comment"></a>Here come the 
comments which you may ask yourself...</b></font></p>

<p><i><font color="#0000FF"><a name="1"></a>1.</font></i><font color="#FF0000"> </font><i>
<font color="#0000FF">&nbsp; You say in your webpage about StartAuction function 
that we must to<br>
check whether an itemNo is already started. However in my application<br>
it is the server which create the item number so how can I detect<br>
whether it is an &quot;repeating item starting&quot;?<br>
　</font></i></p>
<p>Just as I said in my blog, this is called by another kind of client, namely 
auction <br>
managers who are also client in programming perspective. For example, when your 
server <br>
start running, the auction managers also start your client program in some hosts 
and call <br>
your &quot;startAuction&quot; function to &quot;post&quot; item for bidding. Surely you don't want 
your <br>
system can only post some fixed items only, right? Because it is too boring.<br>
So, don't try to initialize your item by server. They must be started by &quot;startAuction&quot;
<br>
which can be called even when bidding already starts. Imagine the real world 
bidding <br>
scene.<br>
　</p>
<p><i><font color="#0000FF"><a name="2"></a>2.&gt; I think that I badly asked my 
question : I understand items are<br>
&gt; started by the method 'StartAuction' but my question was &quot;By which<br>
&gt; mechanism can you detect whether the item is already started?&quot;<br>
&gt; Checking whether the attribute item id is already stored? This can't<br>
&gt; work because I generate an unique item number just before to add the<br>
&gt; item in my hashtable, so they will be never two identical item id.</font></i><br>
&gt;</p>
<p>ok, I now see your point as I have a slightly different interpretation of &quot;startAuction&quot;.
<br>
1. If we allow server to generate item no for us, surely we don't have to check 
conflict item number as long as the item number generating method is correct 
one. (I will talk it later.)<br>
2. If we allow auction manager to input the item no from client side, surely we 
have to check if item number is already in use. <br>
3. I think most people and professor intend to use no. 1). <br>
4. However, in either case, you need to make sure your method is properly 
synchronized. There might be several approaches. <br>
a) Simply using incremental number for next item no. and make sure at least the 
incrementing part is synchronized.<br>
__EnterCriticalSection;<br>
&nbsp;increment(currentItemNo);<br>
__ExitCriticalSection;<br>
&nbsp; return currentItemNo;<br>
b) Using &quot;random&quot; function. But theoretically random number doesn't guarantee 
no-repeating. In some cases, for example, your server generate multiple 
instances and each with the random class starting from the same random seed, 
then your random function will give the exact same random number. In web 
service, if you don't configure your server properly, every call will create a 
servlet to handle your request and you probably encounter this in your third 
assignment. In all, it is a better way to check repeating when you use random 
function.<br>
c) Some professionals may tend to use pre-generated, uniqueness-guaranteed list 
of item no and save them in a table at the beginning of server program. This 
maybe the professional way but a bit out of most students' approach.<br>
<br>
5. In all case, you must prevent multiple requests generate same item number.<br>
<br>
<br>
<font color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b><font size="5"><a name="mistakes"></a>Common Mistakes in Assignment 1</font></b></font></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color="#FF0000">(Some mistakes are not so &quot;common&quot;. However, it is 
worthwhile to notice them before you repeat them.)</font><br>
　</p>
<p><font color="#0000FF">1.&nbsp; By using a single variable of AuctionItem and 
all your &quot;StartAuction&quot; will only insert one item in &quot;ActiveItemTable&quot;.</font></p>
<pre>class DAM
{
	private AuctionItem myItem=new AuctionItem(0,0,0);//some default value
	...
	public synchronized int placeBid(...)
	{
		...
		myItem.itemNo=myItemNo;
		myItem.timeToClose=myTimeToClose;
		...		
		activeItemTable.put(myItem.itemNo, myItem);
		...
	}
	...
}</pre>
<p>This mistake is probably originated from STL of C++ where containers like 
list, vector, set are holding &quot;copy&quot; of item instead of &quot;reference&quot;. 
Unfortunately in java every complex type other than &quot;primitive type&quot; like int, 
float etc are all &quot;references&quot; or &quot;pointers&quot; in C++. So, every time you want to 
generate a new instance, you need use &quot;new&quot;. I think this kind of mistakes only 
happens for java beginners or C++ zealots.</p>
<p><font color="#0000FF">2. How can you return a integer array without knowing 
its length in advance? And how can I iterate a HashTable?</font></p>
<p><font color="#0000FF">The most intuitive idea is to put them in a 
&quot;self-incremental-container&quot; first and later copy them out one by one.</font></p>
<pre><font color="#FF0000">To iterate a hashTable, we can use &quot;Enumeration&quot; or &quot;Iterator&quot;</font>
Enumeration myEnum=HashTable.elements().

AuctionItem temp;
Vector myVect=new Vector();

While (myEnum.hasMoreElements())
{
	temp=(AuctionItem)myEnum.nextElement();
	//and put the temp into a AuctionItem array or vector
	myVect.addElement((Object) temp);
}</pre>
<pre><font color="#FF0000">//now we copy the data item one by one</font>
int[]  result=new int[myVect.size()];
for (int i=0; i&lt;myVect.size(); i++)
{
	result[i]=(AuctionItem) myVect.elementAt(i).itemNo;
}
return result;</pre>
<p><font color="#FF0000">//But I found some guy has a even better way to do it. 
There is a method called &quot;toArray()&quot; of Vector. So, simply return it //without 
copying. This is a purely new discovery for a java beginner like me.</font></p>
<p><font color="#0000FF">3. Why on earth do I need to care about synchronization 
at all? Can system do it for me with &quot;magic&quot;?</font></p>
<p>I think no system will take care about user level synchronization issues 
because system simply doesn't know your application logic at all. So, don't 
escape from this subject! If you want to become a serious programmer, do it by 
yourself. </p>
<p>The following is just a brief repetition about how things are going wrong.</p>
<font SIZE="2"></font>
<pre>In DAM, it is possible that two requests from two clients call &quot;PlaceBid&quot;
for the same itemNo and different &quot;ProposedBid&quot;
Obviously they will get the same reference of AuctionItem in &quot;PlaceBid&quot; and 
call its &quot;PlaceBid&quot; method in a interleaved manner. i.e. a race condition happens here.</pre>
<pre>
In your AuctionItem class, assume your method &quot;PlaceBid&quot; is not synchronized.
Then at the statement of </pre>
<pre>&quot;if bidValue &gt; getCurrentBid())&quot; </pre>
<pre>it may return true when the first request call this and immediately a context switch happens such that the second request gets a 
chance to run the same &quot;PlaceBid&quot;.   Here the second the request may update the &quot;CurrentBid&quot; to a bigger bid and exit. 
When the first request wake up, it continue its execution to update the bid because he thinks the statement above is still true.</pre>
<pre><font color="#0000FF">4. How to design a test case? </font></pre>
<pre>Some of you guys have a slightly wrong concepts in testing. Do we really care about whether any method is correctly synchronized or whether </pre>
<pre>our program runs correctly? Indeed our goal is to run our program with correct result and synchronization is simply just a tool.</pre>
<pre>So, we don't aim to test if some &quot;critical part&quot; is correctly &quot;blocked&quot;. <u><i><font color="#FF0000">Instead we design a real world scenario and test if our program is </font></i></u></pre>
<pre><u><i><font color="#FF0000">giving correct answer.</font></i></u> Of course this is all based on your analysis when, how and where the program can go wrong. That is why professor gives</pre>
<pre>half marks for report! Even though this is just a simple concept, still I think it is worth noticing.</pre>
<pre><font color="#0000FF">5. How to test &quot;placeBid&quot;?</font></pre>
<pre>As I mentioned above, we want to give a real world running environment and test if anything can go wrong. <u><i><font color="#FF0000">For example, the logic behind this is</font></i></u></pre>
<pre><u><i><font color="#FF0000">after all bidders place their bids, only the highest bid get placed.</font></i></u> So, your program should reflect this. Is it simple? This is purely a </pre>
<pre>commonsense and has little to do with any skills of programming language, right?</pre>
<p><font color="#0000FF">6. Do I need to clear up my activeItemTable by a demon?</font></p>
<p>This seems to be a good approach. However, do you really need to create a 
thread to this? The answer is no because what you</p>
<p>need is a Timer instead of a separate thread busy looping. (Of course even 
Timer can be considered as a separate thread. But it is system level and is 
implemented with high efficiency.)</p>
<p>The following is a simple demo:</p>
<pre>Class MyTimerTask extends TimerTask
{
	Private int myItemNo;
	Private DAM myDam;
	Public MyTimerTask(DAM dam, int itemNo)
	{
		myItemNo = itemNo;
		myDam=dam;
	}

	Public void run()
	{
		myDam.removeExpiredItems(myItemNo);
	}
}


Inside class AuctionItem, modify to add a private data of Timer and also 
modify the constructor
Of AuctionItem to pass a reference of DAM.
Class AuctionItem
{
	public	DAM myDam;
	Public AuctionItem(DAM dam)
	{
		myDam=dam;
	}
	Private Timer myTimer;
	public synchronized Boolean placeBid(int bidderId, float proposedBid)
	{</pre>
<pre>		...
		myTimer=new Timer(new MyTimerTask(myDam, itemNo));</pre>
<pre>		...
	}
...</pre>
<pre>}
</pre>
<p><font color="#0000FF">7. In rmi, if you need to return a type or passing a 
parameter other than &quot;primitive type&quot;, then you need to implements its</font></p>
<p><font color="#0000FF">&quot;Serializable&quot; interface. And in most cases, you can 
simple &quot;declare&quot; it &quot;implements&quot; without really doing something.</font></p>
<pre>　</pre>
<pre>　</pre>
<pre>	</pre>
<pre>
</pre>
<p><font color="#FF0000">&nbsp; </font></p>

</body>

</html>
