Beginner Question: Windows Object Oriented Programming

J

JHenstay

I have a "Generic Application Class" which does tasks such as setup
and register the window, etc. The general idea was I could make a
child class of this for my project and inherit all of the necesary
methods. This works fine. My question is in regards to things like
"DirectX" and "Networking". As far as I can tell, I guess I have 2
options in order to implement these things:

1 - Make classes that sit in the hierarchy between my "Generic
Application Class" and my "Application Class" which handle all of the
aspects of these things, like initializing DirectX, Connecting to a
remote server, etc. Then my "Application Class" would just inherit
these methods and call them as needed.

2 - Make independent classes like a "NetworkObject Class" or a
"DirectXObject Class" and just have my "Application Class" create
instances of each of these things and call the methods on the
instantiated objects as needed.

I was leaning toward going with Option 1 because each application
would only require one of each of these type classes (DirectX and
Networking) so I thought that would make more sense.

I just want to know if I am thinking through this properly or am I
heading down the wrong learning path?

Any advice is greatly appreciated.

Thanks!

-JH
 
V

Victor Bazarov

JHenstay said:
I have a "Generic Application Class" which does tasks such as setup
and register the window, etc. The general idea was I could make a
child class of this for my project and inherit all of the necesary
methods. This works fine. My question is in regards to things like
"DirectX" and "Networking". As far as I can tell, I guess I have 2
options in order to implement these things:

1 - Make classes that sit in the hierarchy between my "Generic
Application Class" and my "Application Class" which handle all of the
aspects of these things, like initializing DirectX, Connecting to a
remote server, etc. Then my "Application Class" would just inherit
these methods and call them as needed.

2 - Make independent classes like a "NetworkObject Class" or a
"DirectXObject Class" and just have my "Application Class" create
instances of each of these things and call the methods on the
instantiated objects as needed.

I was leaning toward going with Option 1 because each application
would only require one of each of these type classes (DirectX and
Networking) so I thought that would make more sense.

I just want to know if I am thinking through this properly or am I
heading down the wrong learning path?

This is a C++ language newsgroup, please try to use it to ask C++
language questions. There is another newsgroup for issues like
yours, it's called comp.object. What you're trying to get a grasp
on is called "Object Oriented Design". Once you get the hierarchy
straight, it doesn't matter in what language you'll implement it.
Take my advice, ask in comp.object.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top