[wsf-c-dev] [C++] Exceptions in OMFactory
Senaka Fernando
senaka at wso2.com
Tue Nov 6 23:04:20 PST 2007
On Wed, 2007-11-07 at 11:08 +0530, Samisa Abeysinghe wrote:
> Senaka Fernando wrote:
> > On Wed, 2007-11-07 at 09:08 +0530, Samisa Abeysinghe wrote:
> >
> >> Do we need to have a factory for this API?
> >>
> >
> > Yes, we do, the reason is we need the env for C functions and we are not
> > exposing the reference to it. Thus, when we create OM classes the env is
> > set through the factory.
> >
> > The env of the factory is set from the Service Client.
> >
> How come service client set the env of the factory? It does not make
> sense.
Well, it is like the service client will own a OM Factory that can
create OM Classes. The service client is a friend of the OM Factory and
is the only person who can construct the factory. The user can't create
a factory, but can get the created factory from the Service Client.
> And if that can be done, why not the user can get the env form
> service client and create OM without factory?
The C++ user needs not to know about the env in C. That can be hidden.
The user would create a Service Client, and the Service Client will take
care of setting up the environment.
>
> I see no point in having a factory to share the env.
> >
> >> Do we need to make it that complex?
> >>
> >
> > I don't think it would be complicated. Even Java has a similar approach
> >
> C++ does not need to be the same as Java. You can get the idea on the OO
> hierarchy from Java. But we are not building an equivalant. We already
> have most of the logic in C, so much of the Java stuff is already done.
> We just need an API for the user to use the C engine, that is it.
+1.
The C++ API is an extension of the C API, and will target the C engine
and wont be simply a Java copy. The Factory scenario was just to point
out that it is not complicated. :)
>
> Samisa...
> >
> >> Samisa...
> >>
> >>
> >
> > Regards,
> >
> > Senaka.
> >
> >> senaka at wso2.com wrote:
> >>
> >>> Hi all,
> >>>
> >>> The OMFactory class
> >>> (http://www.wso2.org/wiki/display/wsfcpp/Class+OMFactory) basically is
> >>> used to build OM classes such as OMElement, OMAttribute and OMNamespace.
> >>> The OMFactory is a composite of the ServiceClient class, and can be
> >>> retrieved by calling the getOMFactory() method in the ServiceClient class.
> >>>
> >>> Now, when creating OM objects we may run into situations such as occasions
> >>> in which OM objects can't be created. In such a situation what type of
> >>> exception should be thrown? AxisFault is what is being used at the moment,
> >>> but, I believe it should have some other name.
> >>>
> >>> How about something like OMFactoryException?
> >>>
> >>> Your suggestions are most welcome.
> >>>
> >>> Regards,
> >>> Senaka
> >>>
> >>> _______________________________________________
> >>> Wsf-c-dev mailing list
> >>> Wsf-c-dev at wso2.org
> >>> http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
> >>>
> >>>
> >>>
> >> _______________________________________________
> >> Wsf-c-dev mailing list
> >> Wsf-c-dev at wso2.org
> >> http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
> >>
> >
> >
> > _______________________________________________
> > Wsf-c-dev mailing list
> > Wsf-c-dev at wso2.org
> > http://wso2.org/cgi-bin/mailman/listinfo/wsf-c-dev
> >
> >
>
>
More information about the Wsf-c-dev
mailing list