"Advanced" #2770
phil-levis
started this conversation in
General
"Advanced"
#2770
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We now have two "Advanced" operations in Tock:
hil::uart::ReceiveAdvanced
traitprocess_utilities::load_processes_advanced
I'd like to argue that we avoid the use of
Advanced
as a naming scheme. It's not very descriptive; these two particular use cases have almost nothing in common, yet we see the term used in both. For the UART case, the trait provides an additional method, so it's more like an extension in Rust terminology (e.g.,slice_ext
). In the process case, it's a lower-level method that has more arguments, which the standardload_processes
invokes with some defaults. So it's more like the relationship betweenfork
andclone
; the former is semantically a wrapper around the latter.In
uart
, I'd argue this should beReceiveWithTimeout
. It's what the trait does.For
load_processes_advanced
, I can imagine two paths:load_processes_advanced
to be the basic function, which then different wrappers apply default policies to. In this case, we should nameload_processes_advanced
toload_processes
andload_processes
should beload_versioned_processes
orload_processes_default
.load_processes
to be the basic function, and we'll extendload_processes_advanced
as more options come up, but we really don't imagine multiple policies being around. In this case I wonder why we have this. In this situation,load_processes_advanced
should not be public, and instead we should just add wrappers that call with the different parameters we expect. E.g.,load_processes
andload_processes_ignore_version
both invoke the non-pub
methodload_processes_internal
.@bradjc I'm especially interested in what you think about this.
Beta Was this translation helpful? Give feedback.
All reactions