Tag Info

New answers tagged

0

The best way to think of this is: what if you change your HID. If your comms class handled the awkward aspects of translating a generic description into the byte arrays, then you only have 1 class to change. However, your Hid class might well be the primary object that interacts with the HI, and the hidcomms is solely there as a helper class to transfer ...


5

Let's say that for some reason we'd like to extend the Dial method to accept a structure struct Endpoint { public string pno; ... } class Modem { public void Dial(Endpoint ep); ... } This would cause the whole class to be recompiled - depending on the language and compiler - hence the Send and Recv are. If you'd adhere to the SRP you ...


0

The usual principle of encapsulation (that implementation detail should be confined to as little code as practical) applies here. The information about encoding and decoding the byte arrays should be restricted to one class without a good reason to share it further. The more obvious way to arrange this is for HidComms to translate the byte arrays to and ...



Top 50 recent answers are included