Click here to Skip to main content
15,905,233 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
hi every one i'm stuck with an old code that was writen in c# a long time ago , my first task is to git rid of a god-object almost 10 000 lign , any one has an idea how should i proceed
thank u

What I have tried:

i've tried to analyse the code , and found out that the fonctonalities that are there , are used in almost 50 other classes , (note all the fonctions, each class uses at most 2 to 4 fontions of this class )
Posted
Updated 10-Feb-16 3:46am
v2
Comments
Richard MacCutchan 10-Feb-16 10:14am    
This is not a good question. We have no idea what a "god-object" might be, or why you feel the need to get rid of it.
Sergey Alexandrovich Kryukov 10-Feb-16 11:02am    
This is a well-known anti-pattern. The question makes no sense, of course.
—SA
BillWoodruff 10-Feb-16 13:36pm    
If the question makes no sense, how can it be an "anti-pattern ? ... There's a metaphysical infinite-regress lurking there :)
Sergey Alexandrovich Kryukov 10-Feb-16 14:21pm    
This question is not the anti-pattern. It makes no sense just because there is an enormous number of ways to screw up things, and there cannot be an universal way of fixing them.
—SA
Member 11736914 12-Feb-16 10:40am    
it's just a class that have a looot of fonctions and variables in it like i said 10000 lignes of code that was wreting by two people long time ago

1 solution

Solve the problem in the same fashion that you would eat an elephant...
One bite at a time.

Analyze the problem and see which functionality can be moved to a smaller class.
Then repeat with another functionality.
Then repeat again
And again
And again
Until you are satisfied with what you have.

Note: Don't do this just to change the code. You have to justify making the change.
If it currently works, don't change it.
 
Share this answer
 
Comments
BillWoodruff 10-Feb-16 13:38pm    
But, in this case, does the OP not imply they need to de-deify the object ? Highly likely the code is un-maintainable, as is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900