• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Class normalization

 
Ranch Hand
Posts: 8934
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Scott
What is class Normalization?
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see class normalization


Class normalization is a process by which you reorganize the structure of your object schema in such a way as to increase the cohesion of classes while minimizing the coupling between them.

 
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So would it be fair to say the most often the goal of refactoring is class normalization?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:
So would it be fair to say the most often the goal of refactoring is class normalization?


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.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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...
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:
An example might be interesting...


Yep. I'll try to remember this thread if I ever see one
 
author
Posts: 608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?"

- Scott
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!