So would it be fair to say the most often the goal of refactoring is class normalization?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Aurimas Valionis: A fundamental difference between class normalization and refactoring is that class normalization is typically performed to your models whereas refactorings are applied to your source code.
I agree that models typically can't be refactored in the strict sense, simply because they don't have behaviour.
But besides that, I don't see where the distinction you are drawing is coming from. When by refactoring I increase cohesion and decrease coupling, why wouldn't I call it class normalization?
Joined: Jul 11, 2001
Originally posted by Lasse Koskela:
Most often, probably yes. However, I could imagine someone applying a refactoring to "denormalize" a set of classes in order to make the code more readable, for example.
I could imagine *someone doing that*, too. I'd suspect an alternative design lurking somewhere, though, one in which readability and normalization can coexist in peace.
An example might be interesting...
Joined: Jan 23, 2002
Originally posted by Ilja Preuss: An example might be interesting...
Yep. I'll try to remember this thread if I ever see one
The goals of both class normalization and refactoring are to produce better designs. Normalization rules can be applied during modeling, as can refactoring for that matter. You can also refactor your code to make it "more normal", for that matter.
In short, they're complementary concepts, not competing concepts.
One of my philosophies is that it rarely makes sense to ask the question "X vs. Y" but instead to ask the question "how well do X and Y complement each other?"