Skip navigation

Objects make the most sense in the context of encapsulating code that:

  • Has some mandatory startup that must run (constructors), otherwise the related functions won’t work
  • Has a family of related functions, but not all of them should be called by the class user (private)
  • Has some cleanup routines that should be called when the user is done (destructor)

An example of this is my SecKeyHelper.h file I wrote today. That file is just C functions, but there is some code that must be called before any of the related functions work. On top of that, only 2 functions should really be called by the class user.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: