3 ms·
I'm not sure I understand the different approaches being compared here. Are you opposing 1 and supporting 2? 1. HatsService with methods .get_hats(), .throw_
by Noumenon72 1y ago
I'm not sure I understand the different approaches being compared here. Are you opposing 1 and supporting 2?
1. HatsService with methods .get_hats(), .throw_hats()
2. wearable_hats = db.query(Hats).map(hat => WearableHatDto(hat)
throwable_hats = db.query(Hats).map(hat => ThrowableHatDto(hat)
- Theaetetus 1y ago(2)-ish patterns are more what I have in mind, but note that as soon as you're expecting the same `db.query(hats)` to give you the data you need for both (1) and (2), you might already be pretty far down the wrong road.
- Noumenon72 1y agoI'm trying this right now and I don't get it. There's no difference between HatsService getWearableHats() { return db.query(Hats).toDto() } getThrowableHats() { return db.otherQuery(Hats).toDto() } and # wearable.py getWearableHats() { return db.query(Hats).toDto() } # throwable.py getThrowableHats() { return db.otherQuery(Hats).toDto() }