Programowanie zwinne
Programowanie zwinne Programowanie zwinne
Wzorzec strategia Kiedy refaktoryzować Refaktoryzacja powielonego kodu Długa metoda Duża klasa Długa lista parametrów Wydzielenie metody Wydzielenie metody z parametrem zapisywalnym Przemieszczenie pola w górę Utworzenie metody szablonowej Wydzielenie klasy Klient + zestawienie() : string + zestawienieHTML() : string 1 Zestawienie + raport(Klient) : int + nagłówek(Klient) : string + stopka(Klient) : string + treść(Klient) : string ZestawienieTekst + nagłówek(Klient) : string + stopka(Klient) : string + treść(Klient) : string ZestawienieHTML + nagłówek(Klient) : string + stopka(Klient) : string + treść(Klient) : string Marcin Młotkowski Programowanie zwinne 23 / 62
Kiedy refaktoryzować Refaktoryzacja powielonego kodu Długa metoda Duża klasa Długa lista parametrów Jak używać takiej implementacji Wydzielenie metody Wydzielenie metody z parametrem zapisywalnym Przemieszczenie pola w górę Utworzenie metody szablonowej Wydzielenie klasy class Klient { public String zestawienie() { return new ZestawienieTekst().raport(this); } } public String zestawienieHTML() { return new ZestawienieHTML().raport(this); } Marcin Młotkowski Programowanie zwinne 24 / 62
- Page 1 and 2: Programowanie zwinne Marcin Młotko
- Page 3 and 4: Kiedy refaktoryzować Refaktoryzacj
- Page 5 and 6: Powielony kod Kiedy refaktoryzować
- Page 7 and 8: Prosty przykład void raport(DataLi
- Page 9 and 10: Kiedy refaktoryzować Refaktoryzacj
- Page 11 and 12: Wydzielenie metody ze zmienną void
- Page 13 and 14: Przykład po refaktoryzacji double
- Page 15 and 16: Opis Kiedy refaktoryzować Refaktor
- Page 17 and 18: Opis procedury Kiedy refaktoryzowa
- Page 19 and 20: Kiedy refaktoryzować Refaktoryzacj
- Page 21 and 22: Krok 2 Kiedy refaktoryzować Refakt
- Page 23 and 24: Krok 3 Kiedy refaktoryzować Refakt
- Page 25: Krok 5: tworzenie metody szablonowe
- Page 29 and 30: Przykład Kiedy refaktoryzować Ref
- Page 31 and 32: Wydzielenie klasy Kiedy refaktoryzo
- Page 33 and 34: Długa metoda Kiedy refaktoryzować
- Page 35 and 36: Kiedy refaktoryzować Refaktoryzacj
- Page 37 and 38: Jak to zrobić Kiedy refaktoryzowa
- Page 39 and 40: Warianty metody Kiedy refaktoryzowa
- Page 41 and 42: Kiedy refaktoryzować Refaktoryzacj
- Page 43 and 44: Rozwiązanie Kiedy refaktoryzować
- Page 45 and 46: Zalety rozwiązania krótsza liczba
- Page 47 and 48: Kiedy refaktoryzować Refaktoryzacj
- Page 49 and 50: Kiedy refaktoryzować Refaktoryzacj
- Page 51 and 52: float podsuma(Macierz M, wiersz, su
- Page 53 and 54: Kiedy refaktoryzować Refaktoryzacj
- Page 55 and 56: Kiedy refaktoryzować Refaktoryzacj
- Page 57 and 58: Plan wykładu Kiedy refaktoryzować
- Page 59 and 60: Kiedy stosujemy Kiedy refaktoryzowa
- Page 61 and 62: Zastosowanie Kiedy refaktoryzować
- Page 63 and 64: Podejście 1. Kiedy refaktoryzować
- Page 65 and 66: Krok 2. Kiedy refaktoryzować Refak
- Page 67 and 68: Krok 4. Kiedy refaktoryzować Refak
- Page 69 and 70: Przykład Kiedy refaktoryzować Ref
- Page 71 and 72: Kiedy refaktoryzować Refaktoryzacj
Wzorzec strategia<br />
Kiedy refaktoryzować<br />
Refaktoryzacja powielonego kodu<br />
Długa metoda<br />
Duża klasa<br />
Długa lista parametrów<br />
Wydzielenie metody<br />
Wydzielenie metody z parametrem zapisywalnym<br />
Przemieszczenie pola w górę<br />
Utworzenie metody szablonowej<br />
Wydzielenie klasy<br />
Klient<br />
+ zestawienie() : string<br />
+ zestawienieHTML() : string<br />
1 Zestawienie<br />
+ raport(Klient) : int<br />
+ nagłówek(Klient) : string<br />
+ stopka(Klient) : string<br />
+ treść(Klient) : string<br />
ZestawienieTekst<br />
+ nagłówek(Klient) : string<br />
+ stopka(Klient) : string<br />
+ treść(Klient) : string<br />
ZestawienieHTML<br />
+ nagłówek(Klient) : string<br />
+ stopka(Klient) : string<br />
+ treść(Klient) : string<br />
Marcin Młotkowski <strong>Programowanie</strong> <strong>zwinne</strong> 23 / 62