Business object coding conventions
Rich Johnson
rjohnson at dogstar-interactive.com
Tue Dec 7 15:11:06 EST 2004
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?
--rich
gn
More information about the gnucash-devel
mailing list