Hacker News new | past | comments | ask | show | jobs | submit login
Design better software abstractions using bipartite composition (2019) (cep.dev)
12 points by dmarto 7 months ago | hide | past | favorite | 5 comments



I've done this myself implicitly when trying to break down kitchen-sink classes. Often they were never really one class to begin with, so a lot of the contents can be separated into two or more new classes such that there are only a small number of dependencies between them.


So the opposite of encapsulation?


No, this is just separation of concerns. Each thing that was separated is now encapsulated and can be reused in different places.


“We can use composition to break our ship object into two concepts.”

SHIP : PHYSICAL OBJECT

On the surface this appears very “semiotic”


This feels unnecessarily fragmented and complex.

Sorry don't see the benefits of designing your classes in this fashion.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: