views:

35

answers:

1

I have several classes that were generated from a WSDL and I need to write 2 small applications that read some input data, call the webservice and write the responses.

Right now I created a bunch of very simple wrapper classes that take the data from the objects returned by the webservice call. I created a wrapper around the webservice proxy that returns my own classes instead of the generated types. What I try to aim for is a decoupled model, that will not reveal any of the generated classes to my simple applications.

But I think I may overengineer the whole thing. For now the 2 small applications will be almost the same size as the model classes and wrappers, but I am sure there will be more requirements coming up later and I want to be flexible.

Should I hide the generated classes (and think about this part as a Data Access Layer) or should I go with the generated classes for the first version?

+1  A: 

We are talking in generals here, so I will respond in kind. Unless you have specific requirements that you are building to, don't engineer for the future too much, other than choosing frameworks and methodologies that can be flexible for the future. The thing is, if you engineer for the future now, you don't even have the requirements nailed down so you are working on guesses and worries. See the "You Ain't Going to Need It" principle.

Now for the question of wether you need the Data Access Layer now: if you find that you have a layer that does nothing but translate between two other layers, you don't need it. If, on the other hand, there are a set of tasks that if handled in a layer that will make other layers more concise and clear, hopefully all while reducing redundancy, go for it.

Peter DeWeese
That's exactly my problem. I only need a small subset of the data that is returned by the webservice and I don't want to expose all that stuff to my application (and I assume that I will hand over the whole project to someone else soon, because this is only a side project for me). The returned objects have a lot of methods like *getWkt()* and *getWkp()* and I myself get a headache from reading it. I try to hide all that behind my own objects.
cringe