Skip to main content
GameDev.net gamedev.net
🔒 Locked

logical block

Started by derek7 Apr 16, 2006 at 10:29 AM 1 replies 600+ views
Original Post
derek7
derek7
reuse is a software destination. so I wanna know if it is possible to get block at will. for example I have a class renderquene, it do : sort and group render object and do render. but I do a simple game NOW. it do not need sort and group logical, just set render state and render it. but I find it is hard to reuse the class renderquene, it has several class and struct for sort and group. I must get rid of these class , but I found it is more easy to write render code from new. is it my renderquene design problem? can I design a renderquene that can be reused by the two requirement? what can I do when I meet the problem again? it will often occur when you develop software.
Basiror
Basiror
One solution to this problem is to keep your implementation as general as possible.
That means, do not specialize your class for certain purposes, this will most likely lead to occasions where you use some point of reuseability

Also if you are beginning to work on a new project think about how you design your code, it is often useful to seperate certain reduntant parts into independent classes that can be used across other projects. Its all a matter of design.


Before you start programming on a new project think about which parts you can seperate, this will not only reduce production times on the long run, you will also gain a little code base that makes development easier.



P.S.: I have never seen one with a rating of "ZERO" you probably should start dozens of new threads in the same forum at the same day, it would be better to put them all into a single thread, this will get you more feedback on you questions as well.
http://www.8ung.at/basiror/theironcross.html
Nuno1
Nuno1
derek,
it is very hard to understand what exactly do you mean.

I guess that you have a class implementation that just do not fit your needs on diffrent applications.

there are two reasons for that :

1. it just a diffrent functionalty and needs a diffrent implementation. you just need to write a new implementation for this issue.

2. your code is not abstract enough. designing a well infrastructure should be abstract as possible. probably you can make a base class that will abstract the minimum of your implementation and then implement the extenstions on your inherit classes that will have your diffrent implementations.

hope it make sense to you,
Nuno1

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.