As most of you know (well, maybe), that I have been working on some OO modules for use in a program set (1 server and 1 client) at my job (
found here). In the beginning, I decided that this would be a pure Perl project (well, some C for the over-the-wire transport via
Socket.pm). So far, so good.
Thanks to advise from tilly and others (too many to list), I've been able to abstract most of the elements of my code into a fairly decent class of modules. Student.pm is a base class with constructor and delegate and accessor methods. Student/Server.pm is a module that is for server use (mainly) and has methods for server-side tasks. Student/Client.pm, obviously, is a module used client-side. While there are some definite improvements to be made to the abstraction used in these modules, I think they're almost decent enough to run in production. I will post the code up at my home node (if I can get away with it) for these three modules.
The last things I need to clear up before I can even test the code based on these modules (rpc_server.pl and rpc_client.pl... source for these will be on my scratchpad soon) in production are:
1.) The RPC module I used (alpha module discussed in Advanced Perl Programming) is made with running remote subs (in the form of pkg::sub), not with running OO commands. This causes quite a problem with my OO code (obviously). There are two ways to solve this: a.) use another module (which is somewhat tricky in the Win32 environment, where IPC is kinda shaky) or b.) edit/rewrite the module to allow for OO.
To do the second option would require a lot of time (diving through the code and such). I'm not as familiar with socket programming in perl as most (hopefully, I can get my hands on the Network Programming with Perl book that everyone recommends in the near future), so some of the code that Sriram used in the RPC module is kinda weird to me. If anyone knows of any resources that have information on socket programming in Perl (free, preferably...), please let me know via PM, email, whatever...
2.) Student, Student/Client, and Student/Server are meant to separate functions that are required by the server and client ends. Basically, all of the major client requests are not in the client module at all. They are supposed to be delegated to the server via RPC. I wrote a small AUTOLOAD routine that will copy the student objects, bless them in the server class, and call the method from the server class. This approach works (somewhat), but it requires that the server and client classes be used by the client program (which kind of defeats the idea of abstracting the two sets of code into modules). Would anyone have some suggestions as how to set this delegation up better?
Any suggestions, comments, etc. would be appreciated.
Theodore Charles III
Network Administrator
Los Angeles Senior High
4650 W. Olympic Blvd.
Los Angeles, CA 90019
323-937-3210 ext. 224
email->secon_kun@hotmail.com