I would say option B. In that way you separate concerns: you have a Note
that can be reused anywhere (and not necessarily on a networked application), and you have a manager class that only cares with server communication.
You may also think on implement logic for multiple servers. For example, you may want to comunicate with data formats like JSON or XML. You may implement an interface (example, interface INoteManager
) and then implement two classes with servers for each of the data types I mentioned (example, NoteManagerXml
and NoteManagerJson
).
The main point on this question is sepration of concerns. Hope I've helped! :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…