Restructuring (EVO 2008)

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Restructuring (EVO 2008) - Presentation Transcript

    1. Restructuring Tudor Gîrba www.tudorgirba.com
    2. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } actual development } } } { } } }
    3. fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } restructuring } } } { } } }
    4. cycle ginee ring life Reen fo rw g rin ar ee d gin en gin en ee se rin erv g re { { { { { { } { { } } restructuring } } } { } } }
    5. { { What? { { { { } { { } } restructuring } } } { } } }
    6. Restructuring is often taken as a synonym of refactoring
    7. Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior
    8. Refactoring is behavior-preserving transformation
    9. Restructuring is transforming a program to fit current needs
    10. Why? { { What? { { { { } { { } } restructuring } } } { } } }
    11. Software should be habitable
    12. The secret to tidiness is to have a place for every thing Denker Markus
    13. The secret to tidiness is to find the right place for every thing Denker Markus
    14. If it stinks, change it Be ck Gr andma
    15. How? Why? { { What? { { { { } { { } } restructuring } } } { } } }
    16. Take a critical look at design
    17. A God Class centralizes too much intelligence Class uses directly more than a few attributes of other classes ATFD > FEW Functional complexity of the class is very high AND GodClass WMC ! VERY HIGH Class cohesion is low TCC < ONE THIRD 006 ari nescu 2 L anza, M
    18. ModelFacade from ArgoUML
    19. p God Class Split u ModelFacade from ArgoUML 2 er etal 200 Demey
    20. d than done Easi er sai 2 er etal 200 Demey
    21. also w rap it You can 2 er etal 200 Demey
    22. you do not Maybe uch it at all need to to God Class in the last version isGodClass(last) AND Harmless God Class Stable throughout the history Stability > 90% 4 Ratiu etal, 200
    23. Client Provider service()
    24. Client Intermediary Provider getProvider() service()
    25. Client Intermediary Provider getProvider() service() this.intermediary.provider.service();
    26. Provider2 service2() Client Intermediary Provider getProvider() service() Provider3 service3() this.intermediary.provider.service(); this.intermediary.provider2.service2(); this.intermediary.provider3.service3();
    27. Provider2 service2() Client Intermediary Provider getProvider() service() Provider3 service3() this.intermediary.provider.service(); this.intermediary.provider2.service2(); this.intermediary.provider3.service3(); to str angers eter : D on’t talk of Dem T he Law
    28. Code te Nav igation E limina Provider2 service2() Client Intermediary Provider fullService() service() Provider3 service3() this.intermediary.fullService(); 2 er etal 200 Demey
    29. ge inte rfaces ad to hu t: This can le Provider2 Cavea service2() Client Intermediary Provider fullService() service() Provider3 service3() this.intermediary.fullService(); 2 er etal 200 Demey
    30. Middl e Man R emove Provider2 service2() Client Provider service() Provider3 service3() this.provider.service(); this.provider2.service2(); this.provider3.service3(); Fow ler 1999
    31. An Envious Method is more interested in data from a handful of other classes Method uses directly more than a few attributes of other classes ATFD > FEW Method uses far more attributes of other classes than its own AND Feature Envy LAA < ONE THIRD The used \"foreign\" attributes belong to very few other classes FDP ! FEW 006 ari nescu 2 L anza, M
    32. ser to Data Behavi or Clo Move
    33. Data Classes are dumb data holders Interface of class reveals data rather than offering services WOC < ONE THIRD AND Data Class Class reveals many attributes and is not complex 006 ari nescu 2 L anza, M
    34. ser to Data Behavi or Clo Move
    35. Significant Duplication 006 ari nescu 2 L anza, M
    36. A A m1 m1' m3 m2 m2' 6 ne scu 200 Lanza, Mari
    37. A A m3 B C B C m1 m2 m1 m2 6 ne scu 200 Lanza, Mari
    38. Restructuring can also improve performance
    39. BusinessObject Client BusinessSessionBean BusinessEntityBean
    40. BusinessObject SessionFacade Client BusinessSessionBean BusinessEntityBean java .sun.com
    41. ModelFacade from ArgoUML es are good, Not al l Facad od :) some are G
    42. Trouble never comes alone Ano nymous
    43. Redistribute Transform conditionals responsibilities to Polymorphism Eliminate Split up Transform Client ... Navigation Code God Class Type Checks Move Behavior Introduce Null Object Closer to Data
    44. es pro blems ode co rrelat inC
    45. When? How? Why? { { What? { { { { } { { } } restructuring } } } { } } }
    46. Restructure all the time
    47. Restructure all the time his fea sible? … hm m, is t
    48. It is feasible
    49. Development Maintenance
    50. are evolution Softw
    51. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/

    + Tudor GirbaTudor Girba, 2 years ago

    custom

    506 views, 0 favs, 1 embeds more stats

    I used this set of slides at a lecture I gave at th more

    More info about this document

    CC Attribution License

    Go to text version

    • Total Views 506
      • 489 on SlideShare
      • 17 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 12
    Most viewed embeds
    • 17 views on http://scglectures.unibe.ch

    more

    All embeds
    • 17 views on http://scglectures.unibe.ch

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories