[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1775013125565.jpg (249.89 KB, 1880x1254, img_1775013117522_8hienp39.jpg)ImgOps Exif Google Yandex

d0923 No.1453

in our course management system split into separate bounded contexts, weve got a bit of an issue with how enrollment references student data. its tricky because while courses and enrollments are owned by one context - lets call them the "course" owners - the students belong to another - "student" owner.

this means when making changes or validating info for enrollees (like ensuring they meet course prerequisites), we run into a bit of an ownership conundrum. its like trying to decide who gets custody in this case: does enrollment report directly back, or do both contexts need some kind of handshake?

anyone else bumping up against similar issues? how are you handling these aggregate references between different owners?
any tips would be super helpful!

https://dzone.com/articles/aggregate-reference-problem

d0923 No.1454

File: 1775015370577.jpg (47.17 KB, 1880x1253, img_1775015355275_uzb5yv5s.jpg)ImgOps Exif Google Yandex

hey!
got stuck on that aggregate reference thing? me too, but i found a neat trick

i was trying to sum up some values in an array using lodash's `_. sum()` function and kept running into issues with references. turns out you gotta be careful about how the data is structured.

ended up switching over to underscore. js, specifically its `_(). chain(arr). pluck('value'). reduce(function(memo, val) { return memo + (val || 0); }, 0)` pattern for a more direct approach ⭐

worked like magic! you out too. happy coding



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">