Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Call a method based on string value received - Suggestions?

Reply
Thread Tools

Call a method based on string value received - Suggestions?

 
 
Karthik D
Guest
Posts: n/a
 
      08-18-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP - Spreadsheet::ParseExce - Can't call method "value" on anundefined value perl Newbie Perl Misc 5 05-06-2009 09:44 AM
Help using Spreadsheet::ParseExcel Module - Can't call method "value"on an undefined value perl Newbie Perl Misc 2 05-06-2009 09:43 AM
DataView Find method - Error: Expecting 2 value(s) for the key being indexed, but received 3 value(s) Zenobia ASP .Net 2 06-23-2004 05:15 PM
nuby: determine method passed and determine the receiver that received the method Peņa, Botp Ruby 1 01-24-2004 07:51 PM
Call a method based on string value received - Suggestions? Karthik D Java 0 08-21-2003 03:24 AM



Advertisments