Hi

I delete them, i first encountered them while doing nhibernate work. But it
meant that i could not get the code coverage of my unit tests to where i
wanted. So i deleted them and spent an hour writing coverage tests.

.02c
Davy

Sent from my starfleet datapad.

On 6 mars 2013, at 06:15, Stephen Price <step...@perthprojects.com> wrote:

Thanks guys, sounds like i'm on the right track.

Dave, the objects look just like generated DTOs, so if they were passed
about empty then its probably better covered with validation
(client/server), but I get what you mean. They wouldn't be much use empty
but I think there are other ways to indicate the intent than the Obsolete
attribute. I like Mike's answer too, If only because it matched with my
feelings about it. :)

cheers!
Stephen


On Wed, Mar 6, 2013 at 1:09 PM, David Burstin <david.burs...@gmail.com>wrote:

> 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 <step...@perthprojects.com> 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