this post was submitted on 30 Jan 2025
1 points (66.7% liked)

Software Architecture

270 readers
3 users here now

A place to ask questions and share knowledge on system design and aligning technology to business need.

founded 2 years ago
MODERATORS
 

Hi all!

I'm working on a project that is leaning hard into craftsmanship/clean architecture. It's my first time truly architecting something that people are really being anal about the architecture for and any help would be appreciated. (It's a rare case where there's not much to do and timelines keep getting pushed back due to outside forces)

The main problematic area takes a list of ids and,

  • queries a service for the objects by id.
  • backs them up to an internal data store.
  • change one attribute in each object to a static value
  • saves the new object to the original service

The original service has their own SDK, which includes a proprietary version of the object I'm manipulating. I have two repositories/component classes, one for the main data store, one for the backup. The main data store's repo also includes a translation function to go from my version of the object to the SDK version and back again.

I got a prototype that looks fine, but upon actually having it interact with the service, it turns out that there's an undocumented requirement that several (10+) attributes of the proprietary object are required even though they have nothing to do with my app. And so it fails when trying to save, since those attributes are lost returning my version of the object to the use case. My object only has the ID and the attribute.

My initial thought would be either to add those attributes to either a serialized/json string attribute in my object or to add them all to the object, since repositories are stateless. I'm favoring the former..

I'm just putting it out there to see if there was a better way that I can't see or if there's a better way. I'm thinking we don't need to add that extraneous data to the back up data store.

I'm not going to be able to respond for several hours as it's very late and I'm going to bed. But will respond in the morning.

Thanks for any help in advance.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here