Re: [gnome-db] gda-report-document



On Tue, 2002-10-29 at 18:35, Santi Camps wrote:
> El lun, 28-10-2002 a las 20:23, Rodrigo Moya escribió:
> > On Mon, 2002-10-28 at 19:41, Santi Camps wrote:
> > > Hi,
> > > 
> > > I have been viewing the code of gda-report.dtd and gda-report-document.*, in order to continue the development of gda-reports.  
> > > 
> > > I see that GdaReportDocument inherits from GdaXmlDocument, but it also have a private struct with a property for each attribute defined in the DTD.  I also see that there are enum's defined for some of these attributes.
> > > 
> > > I am asking myself, it could be better not to have these enum's and private struct, and store data directly in the xmlDoc ?  Attributes assignments could also be validated using the DTD and libxml, I think.   Thus, there would be no duplicated information in the data type, and maintaning the information could be easier (now, creating a GdaReportDocument from an file or using _set_ funcitons store the data in diferent places).
> > > 
> > > What do you thing about this?  
> > > 
> > the purpose of the private structure is to hide implementation details.
> > Internally, you can use whatever you want (a xmlDocPtr directly looks
> > fine to me), but always keep the private structure so that you store
> > there any internal data. Doing so prevents illegal accesses to the
> > struct's members.
> >
> 
> That's right, but I see that GdaXmlDocument has not a private structure,
> but some public xmlDocPtr, xmlDtdPtr, etc. 
>
that's because GdaXmlDocument is still present, but was (quickly)
developer too much time ago.

>  I also see that nobody else
> inside gnome-db is using GdaXmlDocument, so I am thinking to make some
> changes in it, like put data in a private structure and try to implement
> some validations against a DTD.  Is there any inconvenience ?
>
no, that's perfect. You could even just remove the XMlDocument class, if
it's not really useful.

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]