TLDR; I have a neat domain model that makes it easy to communicate with an external web service. New requirements have made the external web service’s interface messy and now I have to gather data from multiple places in my model. Is a DTO appropriate to hold all the necessary data?
I have an interface that deals with searching for some domain models. The concrete implementation behind it goes to an external web service for results.
interface IConsentSearch // only one method +Search(Customer) : IList<Consent> class Customer +various properties
My domain model is, of course, much more complex, but this is the gist of it.
Now, I got some new requirements that would allow us to search by
order id in addition to the
Customer‘s properties. In my internal domain model,
orderId has its own little place somewhere (not part of
Customer). The problem is that the external web service interface has a completely different idea of where
Note: it is not an either/or situation: everything
Customer has to offer is mandatory for the search to take place –
order id is just an additional criteria.
I am going to have to change
Search() signature and thought of creating a new DTO in my application service layer called
ConsentSearchDTO. New DTO would serve one purpose: to combine data and models that are now scattered throughout my domain model and necessary for querying the external web service:
interface IConsentSearch // still only one method +Search(ConsentSearchDTO) : IList<Consent> class Customer // still the same +various properties class ConsentSearchDTO +Customer : Customer +OrderId : int
- Does the above
- Is it ok to create a DTO that references domain model classes (
Customer) or should I create a whole new structure that mimics the original domain model? This seems like a lot of work and doesn’t bring me any additional value.
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!