Business object coding conventions

Derek Atkins warlord at MIT.EDU
Tue Dec 7 15:31:03 EST 2004


Rich Johnson <rjohnson at dogstar-interactive.com> writes:

> I haven't seen the following spelled out, so I thought I'd take a stab
> at it.  It seems to reflect the general coding standards currently in
> effect for the business objects.
>
> For any given business object the following applies:
>
> There exist three files for each <object>:
>    - gnc<object>.h - declaring the public interface
>    - gnc<object>P.h - declaring additional object management methods
> not for client use.
>    - gnc<object>.c - implementing the object
>
> The implementation is confined to gnc<object>.c, including the
> defininition of struct  _gnc<object>.
>
> Client code #includes only  gnc<object>.h.  The client is aware only
> of the datatype Gnc<Object>, defined as "typedef _gnc<object>
> Gnc<object>".  The client only deals with an unspecified structure via
> pointer--it remains blissfully unaware of _gnc<object>'s internal
> structure.
>
> Did I get it right?  Should this sort of stuff be contributed to the
> devel wiki?

Yes, you got it right, but I don't think this is at all necessary to
get documented beyond that.  It's pretty much "opaque object
programming 101".  This usage is even documented in the files
themselves, so I dont really think it needs anything beyond that.

> --rich

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list