You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Samisa Abeysinghe <SA...@virtusa.com> on 2005/07/04 07:22:08 UTC

Exception model

Hi All,
            PFA the class diagram of current exception model we have.
            
            Looking into the several issues we have against the
exception model, it is worth considering a re-arrangement here.
http://issues.apache.org/jira/browse/AXISCPP-707
http://issues.apache.org/jira/browse/AXISCPP-721
http://issues.apache.org/jira/browse/AXISCPP-722
 
            The idea is *very* simple here.  (basic OO stuff)
1.       We have m_sMessage and m_iExceptionCode as data members in all
the derived classes - move them to base class. Move the access methods
to the base class as well.
2.       Drop all processException() methods and move the logic to
constructor
3.       getMessage() methods in the derived classes do not get the
message rather return the message corresponding to the exception code.
Hence rename getMessage() getMessageForExceptionCode()
4.       We have "what()" in the base class to get the error message.
This is a virtual method inherited from the 'exception' class hence we
cannot change the naming. However, better to have a more sensible name
like getMessage to wrap this
5.       There are too many constructors in the derived classes, I would
like only two constructors for each class
a.       Copy constructor
b.       Constructor with 2 parameters, exception code and message, with
message defaulting to null. ExceptionClass(int code, char* msg = null)
 
Thanks,
Samisa...