~/talk

Refactor with Factory Design Pattern

Talkat CakeFest 2022 · 2022-09-29..09-30· [software-architecture, php]
links:none on file
slides:none on file

Refactors a sprawling switch-based CSV importer into a class-per-format solution using a Factory pattern that returns objects implementing a schedule type interface with methods to detect type, format dates, extract lines, check duplicates and yield time slots. Built as CakePHP classes (inheritance, traits, collections) and a thin controller/behavior, it produces a CakePHP ORM entity that parses three real formats. Unit tests run the same data provider against legacy and refactored code and show matching 20, 9, 8 results, proving the refactor works.

AI-written summary · about

  1. 0:00Introduction and context
  2. 2:13Legacy code challenges
  3. 5:37Analyzing the legacy logic
  4. 10:26Implementing the factory
  5. 16:34Refactoring the controller
  6. 20:21Validation and unit tests
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.