• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To the Author!

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

How can the design be kept consistent with the refactored code?
It is my understanding that Refactorings are typically applied at the implementation level, but do these changes also affect representations at the design level.




Thanks.
[ September 08, 2004: Message edited by: Mcgill Smith ]
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you are going to change is the internal structures, while changes to internal structures should not affect the overall design.

Nick
 
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 is changing the design. The idea is to improve structure without changing functionality.

The refactorings presented in Martin Fowler's classic, "Refactoring: Improving The Design of Existing Code", affect mostly the class-level design of the codebase being refactored. However, one can apply refactorings that affect the architecture of the codebase as well.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mcgill Smith:
How can the design be kept consistent with the refactored code?
It is my understanding that Refactorings are typically applied at the implementation level, but do these changes also affect representations at the design level.



When you speak of design, your probably mean design documentation external to the code?

Typically your design documentation should only handle the high level view of the design. If those are affected by a refactoring, you either need to update it, or abandon it...
 
author
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you talking about how to keep documentation in synch with the code?
 
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 Ilja Preuss:


When you speak of design, your probably mean design documentation external to the code?

Typically your design documentation should only handle the high level view of the design. If those are affected by a refactoring, you either need to update it, or abandon it...



I do agree with Ilja Preuss... The design should only be at the high level view... The design should be consistent throughout the project and refactoring the implementation codes should not affect the original design...

And also like Lasse has just mentioned, refactoring is changing the design inside the code. The idea is to improve structure without changing functionality, which is specified in the design documentation.

Here we need to able to seperate between program design and project design...
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refactorings are typically applied at the implementation level (YEP), but these changes may also affect representations at the design level. Given the behaviour-preserving nature of refactorings, it should be possible to identify what parts of a design (say, a statechart or sequence diagram) remain unaffected and what parts must be refactored accordingly. It should be possible to organize sets of refactorings at the implementation level into larger entities that are meaningful at the design level.
[ September 09, 2004: Message edited by: Amer Khan ]
 
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


Refactorings are typically applied at the implementation level (YEP), but these changes ALSO affect representations at the design level.


It depends on how deep we perform refactoring. For lower level, we may only affect the internal coding, as well as the internal design.

For higher level, it may no longer a refactoring, you may already redesign some of the whole modules or functions.

Nick
 
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 Nicholas Cheung:
For higher level, it may no longer a refactoring, you may already redesign some of the whole modules or functions.



Nick, is there any such refactoring in high level design like you said? I can't imagine it... Redesigning such issue is very bad in the real project, I guess...
 
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


Nick, is there any such refactoring in high level design like you said? I can't imagine it... Redesigning such issue is very bad in the real project, I guess...


Sometimes. For example, at 1st, we just want the system to provide A, B, C functions, and we configure it as generic enough to add in more modules. However, now, we want to keep A, B, C functions, and add D function. But D function is very different to the 3 functions, such as, say 3 years ago, we develop Web applications. Now, in addition to web, we may want to use Portlet to support portal application as well. Thus, we may need a high level refactoring, as the existing system does not expect the new stuff comes out.

I am now working with this migration, and this changes the overall design, as I cannot expect the Servlet is my application entry point anymore.

Nick
 
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 Nicholas Cheung:
I am now working with this migration, and this changes the overall design, as I cannot expect the Servlet is my application entry point anymore.



So you are now applying high level refactoring in your case? And how is that? Solved or still processing on it?
 
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


So you are now applying high level refactoring in your case? And how is that? Solved or still processing on it?


I am currently working on several projects, and one of them is to adopt the Portlet stuffs to support Portal applications. Now, we consider to make use of the idea of Filter Chain concepts, a.k.a. Interceptor, to process those requests. But it is still under review.

And one of the projects is about the Session data management, which I have discussed with you somewhere here.

And another one is about the new subsystem to plug in into the existing system.

And one more is to prepare for SCEA.

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

Originally posted by Ko Ko Naing:
Redesigning such issue is very bad in the real project, I guess...



Actually, it's a quite important thing to do. The high level design is vital for the success of a project, so if you find out that it isn't adequate any longer, you should definetly adapt it!

I am working on a project that is now running more than five years, and we regularly find that we have to reorganize modules. For example, we recently started to add a web interface to our until then Swing-only product. Naturally that had some impact on the architecture, and we are still working on improving it.

But there are also more common reasons, such as a module becoming to big and needing to be splitted; or the desire to reuse some logic in some more general context.

In my experience, it's virtually impossible to get the architecture of a system exactly right from the beginning. There are not many things you can do about it when you find that it isn't:

- just live with an architecture that does not work well,
- start over and hope that it will work better the next time, or
- improve the architecture during the project.

I know which way I prefer...
[ September 10, 2004: Message edited by: Daniel Mayer ]
 
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 Daniel Mayer:
[...]and we regularly find that we have to reorganize modules.[...]



How do you organize/manage the source repository (which one) to keep the history?

./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

Originally posted by Ali Pope:
How do you organize/manage the source repository (which one) to keep the history?

Some version control systems support moving/renaming files and directories, which allows you to do some moving around without losing the history.
 
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:
Some version control systems support moving/renaming files and directories, which allows you to do some moving around without losing the history.



Knew this... but can you name some of 'em? Using cvs is not really giving you the freedom to reorganize the modules :-(.

./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

Originally posted by Ali Pope:
Knew this... but can you name some of 'em? Using cvs is not really giving you the freedom to reorganize the modules :-(.


At least Subversion, ClearCase, and (to some degree) Perforce.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic