We have two modules: D and S. S has a Web Service interface, which is being used by D.

S's responsibility is managing a domain of objects held in a folder-like structure. So, it contains a method like: object Get(Path path), where Path DTO represents a collection of strings, which are components of a path (i.e. to get an object stored under /x/y/z you call Get with path containing an array ['x', 'y' ,'z']). Conceptually path is an identifier of an object.

One of D's responsibility is to present charts with data acquired from some of S's objects. D allows users to choose desired S's object using a tree navigation view. So effectively, a user chooses a path, which is an "address" from which S's object needs to be retrieved from S.

The problem is that we don't want D to have "arrays of strings" floating around it.

However, we also don't want D to understand how path's work (i.e. what the separator is, that empty path components are not allowed, there must a leading separator to start from root, etc.) thus effectively duplicating S's logic.

And also, we don't want to have a dependency from D to S stronger than Web Service, because that's one of the point of Web Service's.

We obviously have some other ideas, but unsure about any of them.

1 Answer 1


You somewhat contradict yourself with saying D uses a path to query on S but you don't want D to know about paths.

Can you not just interface around an identifier of the object the path leads to? Where you store something does not necessarily dictate how you reference or identify it?

My answer would be assign an ID. Let S figure out the path if needed without D knowing about it.

  • That's a good point. However, what I mean is that, while you use an ID to access a row in a database, you don't have to know the logic behind generating such IDs. In this sense, you don't know everything about IDs.
    – BartoszKP
    Jan 27, 2017 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.