← Graph

How does naming an abstraction relate to OOP design?

question 2 connections

An audience member asks whether Wójtowicz's 'frequencies' refactor — pulling a fishy piece of code behind a named method/message — is the same as OOP's advice of thinking in terms of messages and grouping methods into cohesive classes. Wójtowicz agrees in spirit: the refactor can be implemented by adding a frequencies method to Array (like ActiveSupport) or by returning a new FrequencyMap class whose only operations are min_value/max_value. The key move is reducing API surface area: making the class 'weaker' (fewer features) increases cohesion, giving you a frequency map rather than a full hash map.

answer_summary
Yes — the refactor is about naming a smaller abstraction with less API surface. Implementable as an Array extension or a new FrequencyMap class; shrinking the API makes the abstraction more cohesive.
question How does naming an abstraction relate to OOP design?
about
Relates the frequencies refactor to reducing API surface area.
question How does naming an abstraction relate to OOP design?
asked_at
Second Q&A question of the talk.

Provenance

Read by
4 extractions