Hi Stephen,

Just taking a stab at it. Are any of the parameters in the overloaded
constructors dependencies of the object being constructed? If the object
requires these dependencies that would be a good reason to force the
paramaterized constructors, as using the default would potentially leave
the object in an unworkable state.

Cheers
Dave


On 6 March 2013 15:59, Stephen Price <[email protected]> wrote:

> Hey all,
>
> The project i'm working on at the moment has some generated code from a
> tool called MyGeneration TOOL. It has marked the default constructors of
> the Data classes with:
>
> [Obsolete("For serialization only", false)]
>
> It would seem that they have ignored this and are using the default
> constructors and then populating the properties, rather than calling the
> overloads with parameters. In some cases it seems quite valid to just call
> the default constructor (ie a new data object yet to be populated for
> example).
>
> I've done some searching and can't find any justification for marking the
> default constructors Obsolete. Given that the code is generated and then
> manually pasted into the classes I'm tempted to just remove the Obsolete
> attributes. It would clean up the Warnings generated drastically. Just want
> to figure out if it might bite me for some reason down the track.
>
> flames, opinions, ideas, suggestions and feedback welcome :)
> cheers,
> Stephen
>

Reply via email to