Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Design patterns exercise in Java [closed]

Hi I have an assignment to teach a team the subject of design principle. As a final exercise to this mini course, I thought to give them an exercise in design pattern, in Java. My idea is to give them a code written badly, and they should refactor it using several design patterns. I didn't find anything similar to that in my search (both in the web and in stack overflow).

Any references to something similar to what I'm looking for?

Thanks

like image 653
duduamar Avatar asked Feb 27 '11 16:02

duduamar


2 Answers

One of the best sites out there : http://www.industriallogic.com/xp/refactoring/catalog.html

They basically show you code, and then the re-factored code. Its not going to be one big hopping pile of crap, but you can take an aggregate a couple and aggregate them together to form some ugly code, and then do the same to show the solution.

like image 51
Nix Avatar answered Sep 26 '22 02:09

Nix


You can check this book "Refactoring: Improving the Design of Existing Code" of Martin Fowler. It contains examples of "smell" coding and provide solution to refactor it.

like image 32
Thuy Avatar answered Sep 24 '22 02:09

Thuy