开发者

Documenting incomplete object graph of DTO object [closed]

开发者 https://www.devze.com 2023-02-09 00:24 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing
Closed. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 4 years ago.

开发者_运维技巧 Improve this question

The current architecture is based on WCF services which populate DTO objects from DB and return them.

Some methods return complete object graph, some only partial. If completely populated, some object graphs would be extremely large - so that is not an option for all cases.

How to document what properties of the DTO object out of many are populated and which aren't? It's a .NET shop and XML comments don't provide enough flexibility to document not-always-populated properties. How do others tackle this challenge?

Ex: To the client an Invoice object is the same, whether it has all properties populated or not.

One idea proposed is to generate XSD schema for an object with only the populated properties. This doesn't seem like a "good/usable" documentation, although technically correct.

EDIT: I found that UML might be a better alternative than XSD as it's more readable. Is there a quick way to go from XML -> XSD -> UML (or another diagramming paradigm)?


In one of our systems we actually use 2 models: one is internal which is all completed and mature, another is used in services like contract between our system and external parties. we created auto generated mappers and fillers. This gave us possibility to change our internal representation and structure of the object model without breaking external system's data contract.

0

精彩评论

暂无评论...
验证码 换一张
取 消