Not too long ago I started a new job where they've been using WCF for all data/business logic between UI and backend which is great.
Something I've noticed is that the vast majority of these WCF service calls contain a variety of parameters. For instanced, say you have a service call called GetFoo. Here we might use a signature as follows:
public Foo GetFoo(int? ID, string Name, DateTime? fooDate)
For a more object-oriented approach you might instead use:
public Foo GetFoo(Foo foo)
In this case, the code grabs what it needs from the Foo
POCO object instead of depending on a specific set of parameters passed in from UI.
On the one hand this provides a more flexible contract between UI and WCF Service. We can make changes to implementation on service side without breaking any contract and updating references. Additionally, we can have business object which acts upon the POCO directly vs. dealing with an explicit list of parameters.
On the other, it is not clear what is needed in order to get the objects/data you want back.
Which approach would be considered best practice?