On Sat, Jan 18, 2003 at 06:50:51PM +0530, Tahir Hashmi wrote:
through one central config file. Java's dynamic class-loading mechanism helped me a lot here.
You can do all of this in C and C++. "Dynamic class-loading" needs to be OS supported and you can have this done in C and C++.
As you can see in my earlier post, I am interested in knowing about implementation of plugins in C/C++. If by "dynamic class-loading in C/C++" you are referring to the dlxxx calls, let me tell you that from whatever little I have read about them, they are really not usable. They don't guarantee type-safety, and require various workarounds (atleast if you want to work with classes). Feel free to correct me if I'm wrong here.
Java gives me a clean way to integrate these plugins also thereby providing type safety. I have also used its serialization capabilities for storage of message-ids etc.
I am of the opinion that each of these languages has its place, and the decision to use one over the other is totally upto the developer in question. For me, speed of development is very important. When I look back and think if I had tried implementing the same in C/C++, I am looking at all these issues (from the top of my head):
- IMAP / POP3 client implementations (I also have experimental NNTP) - SMTP client implementation (for delivery to an MTA) - Mail storage implementations (mailbox, maildir) - Class loading (with type-safety) - Configuration - Logging
Some of these issues are resolved by the Java language itself. Some are Java extensions. With the extensions following well defined specifications, the learning curve to use the extensions is also very little.
I see speed of development, class-loading abilities and the availability of extensions and libraries as the primary factors in using Java in this particular case.
-- Tahir Hashmi (VSE, NCST)
Cheers, -g