Sign in to follow this  

logical block

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this