• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

refactoring to pattern - which come first ?

 
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, mr.Joshua Kerievsky,in development, should we have refactoring first or pattern ? thank you !

[ September 08, 2004: Message edited by: Alvin chew ]
[ September 08, 2004: Message edited by: Alvin chew ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refactoring should be a continuous activity -- making small refactorings as you see the need for them. The use of design patterns should also be a continuous activity in the sense of keeping your eyes open for opportunities to simplify your design using a well-known design pattern.

However, neither of these should be goals as such. Mandating things like "you must use design patterns" will most probably lead to over-engineered code that misuses patterns.
 
author
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Being test-driven is what always comes first for me. Refactoring is what I do continuously while I'm in a test-driven rhythm. My knowledge of patterns and how to safely refactor to, towards or away from them is helpful when I refactor. My pattern-directed refactorings tend to be implemented by composing together low-level refactorings, such as Extract Method or Move Method.
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Joshua Kerievsky:
My pattern-directed refactorings tend to be implemented by composing together low-level refactorings, such as Extract Method or Move Method.



Joshua,
Is that low-level refactorings discussed in your book? I don't see any chapter that suit the low-level refactorings... Or is it in the chapter-4 Code Smells?

I've read the sample chapter-2 also, but I don't see that low-level refactorings there too...
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please post out, or give me some samples from your book about low-level refactoring?

Nick
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i might miss out ....what is low level refactoring as you guy mention ?
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alvin chew:
i might miss out ....what is low level refactoring as you guy mention ?

I believe those are (in the context of this discussion thread) the type of refactorings introduced in Fowler's book, e.g. "Extract Class", "Extract Method", "Add Parameter", etc.

Fowler has published a handy online catalog of his refactorings.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
Fowler has published a handy online catalog of his refactorings.

...just like Joshua has done with his catalog.
 
Ranch Hand
Posts: 8953
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great links Lasse ! thanks a lot!
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you,Lasse , it is nice link ..do you have good link for design pattern ?
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Alvin chew:
do you have good link for design pattern ?

I'm afraid not, although our OoDesignFaq should be a good place to start.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the link, Lasse.

By the way, you seems know a lot of many areas, what is your major interest?

Nick
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nicholas Cheung:
By the way, you seems know a lot of many areas, what is your major interest?

Well thanks for the compliment. You getting the idea that I know a lot of many areas is probably due to the fact that I'm trying to be a "specializing generalist" -- know enough about most things to know where to look for help when you need to dig in deeper. Obviously the answer is always the same: "JavaRanch"
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't heard till now about low level refactorings. Are there also medium level or high level refactorings? Can somebody point me to this ranking?

10x

./pope
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...and a chronic addiction to professional literature helps as well
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ali Pope:
I haven't heard till now about low level refactorings. Are there also medium level or high level refactorings? Can somebody point me to this ranking?

At least I am not aware of any "official" ranking beyond
low-level refactoring ~ "this thing I'm doing only affects a handful of classes"
high-level refactoring ~ "I'm going to split that backend layer into separate business logic and persistence layers"

(and that was my off-the-cuff definition for "low-level refactorings" and "high-level refactorings")
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
At least I am not aware of any "official" ranking beyond
low-level refactoring ~ "this thing I'm doing only affects a handful of classes"
high-level refactoring ~ "I'm going to split that backend layer into separate business logic and persistence layers"

(and that was my off-the-cuff definition for "low-level refactorings" and "high-level refactorings")



As far as I see in the TOC of the book, I guess they are not covered in Joshua's book... So we might need to grap some other books to get to know about them...

But at least we now know what they are by the explanation given above by Lasse... Thanks a lot for that, Lasse...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lasse,

Any info about low/high level refactoring? I wanna read some more in this area.

Nick
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
At least I am not aware of any "official" ranking beyond
low-level refactoring ~ "this thing I'm doing only affects a handful of classes"
high-level refactoring ~ "I'm going to split that backend layer into separate business logic and persistence layers"

(and that was my off-the-cuff definition for "low-level refactorings" and "high-level refactorings")



One more categorizing that will improve our lifes :-(. I think it sounds more geeky to say "high-level" and "low-level", instead of refactoring. hmmm...

./pope
reply
    Bookmark Topic Watch Topic
  • New Topic