Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Call a method based on string value received - Suggestions? (http://www.velocityreviews.com/forums/t125858-call-a-method-based-on-string-value-received-suggestions.html)

Karthik D 08-21-2003 03:24 AM

Call a method based on string value received - Suggestions?
 
Hello All,
I am working on a small project (of my own to learn Java N/W
programming)which is to implement a FTP server.I am newbie in
designing Java programs.
What I am trying to achieve is when a ftp client sends a message
like USER,PASS or some message I wanted to invoke the appropriate
method which does the processing of client's request and sends the
response back to the client?
I read the client's request from the socket through BufferedReader
Stream.
For e.g when I receive a string called PASS I would call PASS()
method which sends the request for password to the client asking the
user to enter the password to login.
I read in the newsgroups(comp.lang.java.*)that to invoke a method
dynamically one can use reflection APIs to achieve it.Some of them
told reflection APIs have some problems/overhead.
Is there any other way I can invoke methods based on a particular
string value?
One more question.I have read little about design patterns.But I
used to get confused where to use which patterns while designing the
programs.I would like to understand design patterns well and apply
them even in my small Java projects.Any suggestions for designing
better java programs?

Thanks & Regards,
Karthik


All times are GMT. The time now is 02:23 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.