❔ Who to unify data access within a program.
For a quick bacground. I like being able to see where things are happening. If something is "hiding(AKA I can't inspect the code and see what it is calling)" connections through fancy practices I consider a code smell. Likewise How data is accessed should be clear in my opinion. Receiving data shouldn't change the data's state. There are more protocols for external data, like accessing data bases, or APIs, but I haven't seen a good protocol/framework for within a program.
There are some guidelines programmers fallow that help, like naming conventions. Some have performance hits, just as I imagine other protocols do. Have any of you made/used protocols for within a program?
8 Replies
Protocol...
By definition is not required with a program
What do you mean?
Protocol is a procedure for transmitting data
If your context is within a program, there is no transmitting
I guess it is a perspective thing. I was thinking of it as classes transmitting to eachother.
Its like asking are you going by plane train or automobile, when you're moving from the lounge to the kitchen
I mean within programing though we have different levels of complexity around data. Just most of the times it is put as suggestions rather than required.
Like DI for example, you can just assign the data by hand
But the rules there are very wibbly wobbly within DI even, and change from case to case
Which I guess might be the biggest thing. Within programing we can specify for our specific case, where protocols unify over many different cases.
That flexibility of course brings complexity.
Check out Mediator
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.