Hi Rustaceans, I am a C++ developer looking for some answers from the world of Rust. I am basically trying to implement loose coupling of sw components in a project where dynamic polymorphism is not allowed for performance reasons. To me this sounds very rust-ish. My primary reason for doing this is to be able to mock and stub the component interfaces for automatic testing, and normally I would use abstract base classes for interfaces and inject the components into each other as depencencies. So to the question... is it possible using basic language features to create two structs that both implement traits that are used by the other, inject the structs as dependencies to each other and also be able to stub or mock these structs?

7
1
ODROID-GO Super
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearWH
    WhatSheSaid
    Now 100%

    Now one is underway so i will get to see for myself =) the last linux handheld I had was the OpenPandora (full keyboard) so a device without even usb host would be to big of a leap. will definitly check out void for this

    1
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPR
    Jump
    What is your opinion of automated UI testing?
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPR
    Jump
    *Permanently Deleted*
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPR
    Jump
    Modern SW Design book recommendation
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearWH
    WhatSheSaid
    Now 100%

    thanks, I will check out large-scale sw development. With new, i am thinking that a lot has happened since say C++11 wrt compile-time polymorphism that opens up for new ways to implement known patterns. Also i have worked mainly embedded, so if there are arhictectural patterns that are common for for example Java/C#/rust/go developers it would be nice to catch upnon that as well

    1
  • "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearPR
    Modern SW Design book recommendation

    I have been working as a C++ developer for some years now, and have lately gotten more interested in finding out what are the best practices for SW design. Think SW architecture, UML, design patterns etc. Can anyone recommend a good (and fairly new) book for modern SW design, preferably with UML examples?

    5
    3
    "Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearWH
    Now
    2 6

    WhatSheSaid

    lemmy.ml