-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Api Design targets 2.0 discussion #74
Comments
So we are saying that this lib is providing 2 functionalities
To me these are two completely different things and should be treated as such also because it would allow parallel coding on different areas
Sure it does imply some duplication but this duplication would probably fulfill the SRP. Moreover:
About this
1 and 2 are feature requests and/or bug fixes so to me they really must be done, but they do not belong into the design category even if some API signatures may change (e.g. from More specifically about the My 2 cents |
Assuming we would go with seperate objects in the parser/packer part then firstly if would move the packer to a different namespace or even a seprate project in the solution? Would that mean two nugets? Or shoudl we keep everything in the one solution? Another question would be how to handle data that should be accessible in the packer for example lets say multiplexing and as a second example if a signal has limits. Both informations could also be possible relevant for the normal use. For the parser itself there is the question how and when to create a usefull datastructure. For example i would consider a usefull datastructur for multiplexing/extended multiplexing to be: Message knows if it contains multiplexed signals or not; The structure above is impossible to generate while parsing and can only be generated when parsing is done in a final step. As it currently stand many of the useful properties like multiplexing is done via extension methods. which kinda solves the problem of having no final point in time where these stuff can be calculated. However this is inconsistent across different stuff. E.G. IsInteger is calulated during parsing. |
Let me point out that if we are talking abount a 2.0 version then a API breaking change can happen.
which returns an object (this is pseudocode!) from which you can pick the requested signal and call unpack on it
This would hide the
The main point is: Signal/message properties should be there for browsing the dbc only. If we don't allow the packer to request those info, we may simplify things. But if you refer to keep the packer external and passa a regular For more details we need to write some code |
before i would start on the packer stuff i would still want to define the "End of parsing:freeze" stuff.
as for the splitting of packing and unpacking i would only create one class that does both. Depends were you see your SRP. (For me its message handling which includes packing and unpacking. |
Goodnight |
In the poc/immutability branch there is a strating point on how I would do it. In particular I would focus on:
If this was my codebase, I would go down this way. Cheers |
@Adhara3 for the current version i have some remarks; Some where allready present before just want to list them to. And obviosly you only touched message and signal so im focusing on that.
|
I thought we were talking about design. Anyway:
Abou tpoint 8. Out of scope here, IMHO. I agree with you and your idea of having a smart object somewhere to pack&unpack structured multiplexed data,
My idea is to have something like (psudo) var reader = message.GetReader();
byte[] data = can.ReadFrame();
reader.Read(data, (signal, value) => {
// The reader has been built to dinalycally adapt to message, it knows about muxors and
// so here we get a callback for each signal actually in the message based on muxor values
}); Today to call So, let's first release a version with the immutable part that fixes some issues and improves the code, small changes, a little step:
This won't be the final version, won't fix and solve everything but at least we close something and move forward. To start with something on the new Pack/Unpack instead of messing around with the If this approach does not suit your needs, please @EFeru make @Uight a collaborator so that he can go on on his own. Peace |
My proposed timeline:
Can we agree? |
@Adhara3 i can agree but you might want to do:
(3 could be pretty much done whenever it fits best) |
Before point 4, especially before releasing API 2 we need to see the code and further discussing on how to read write. |
So recap targets for API 2.0 are:
Unsure about #92 and #91 for now..... (all other current tickets should be solved with 2.0) What else? or more specifics? (And then parser rewrite after that?) |
This issue is to be used to discuss how the API of the DBC Parser should be changed to allow max usability across multiple use cases.
For me the use case is parse the dbc once and then use this data to send and receive can and can fd farmes.
The only real requirement for this is that the receive stuff should be fast (fast enough to handle more than 1000 messages per second optimally sequential but i would also parallize it if thats not reachable) Send must not be that fast as normaly we would only send a few messages with cycle times of around 10ms or less. Maybe in the ballpark of 200 messages per second.
Additional requirements:
For this i see some possibilities.
From my test with the benchmarker for the packing and unpacking i know that you can not afford to calc any properties everytime.
There are some properties relevant in this for receiving especially.
Does the signal have a scaling (factor or offset) if not dont calc it.
Does the message i receive contain multiplexed signals? And is a specific signal multiplexed.
To achieve this i would consider several options:
Big contra in this is that you pretty much have all classes duplicated (just like currently with teh immutable stuff). This introduces more maintainace and probably some inconsistensies with every change.
Pro: No api change. Probably the fasted way possible but i wouldnt say you need every grain of performance as then your probably using the wrong system anyway
Contra: Api changes, only reasonably fast
Pro: no duplicated classes
Ill write more on this if more stuff gets to my mind ;)
The text was updated successfully, but these errors were encountered: