...
I have quite complicated class, and i would like
to move one method's body of this class to other file ?
Is it possible ? How ?
If you mean to separate the one class into several sourcefiles, I don't
think thats possible.
On the other hand, who knows what's coming up in the future (I believe that
this option will be available in next version of .NET/C# for instance).
However, if you have a too complicated class, there's a possiblity that your
design of it could improve through abstraction, and hence actually separate
the methods between more classes.
"Static" methods are often possible to separate to other classes, but with
instance methods the only way is through some kind of abstraction.
To give a *small* example:
Say you have this class:
class A
{
void first() { ... }
void second() { ... }
}
You could separate the methods with this design:
abstract class Abstract
{
void first() { ... }
}
class A extends Abstract
{
void second() { ... }
}
Without looking at the actual code I can't really tell, but in my experience
a complicated class or method is often the result of not using patterns for
low coupling and high cohesion, e.g. polymorphism.
just my 2c
// Bjorn A