|
I personally don't like either option. Why create two classes that duplicate the same information. I would create a property in MyFooClass to point to FooDto. Or better yet, inherent MyFooClass from FooDto.
|
|
|
|
|
FooDto could be final for all we care. its whole intent, purpose, life cycle, is to turn Data into JSON and vice versa. Nothing more....
mm.. I'd like the idea of justsharing my own internal status class... but that won't fly either.. plus I have been forced to take in some dependency that prevent having these internal status in shared library.. So I do need to duplicate them in contract library upon which I depend
|
|
|
|
|
To quote Alan Perlis: If you create a function with 10 arguments, you probably missed one.
|
|
|
|
|
Option 2.
There should never be a possibility where an object can get constructed without it being initialized properly. Making them mandatory or optional parameters to a constructor achieves that, and the compiler will find every last place where someone has initialized the object incorrectly. Not only that, it'll run very early in the development process, ensuring that the developer that just added the new parameter has all those details still fresh in their head when the bugs are found. What better unit test could you possibly hope for?
The other aspect of how you've been asked to rewrite that code is also a better practice -- you've been asked to reduce the public interface by removing the property setters. This just ensures that nobody can reach into your object and twiddle those properties after it's been constructed. If someone needs that, they can change your code, but hopefully they will evaluate whether there's a better that ensures the object can't be put in a bad state. If the object can't ever be put in a bad state, you can't have bugs because someone was sloppy.
|
|
|
|
|
|
We're actually mostly scared of the drop bears.
cheers
Chris Maunder
|
|
|
|
|
That's one in the last panel, I think.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And I can't read any of it, "because the authenticity of the received data could not be verified". I guess it has to do with invalid SSL certificates or something in that direction.
|
|
|
|
|
In a recent survey, 2/3 of the lions said that they were happy to serve as King of the Forest, while another 1/9 thought it was way too much responsibility. If 14 lions gave one of these two answers, how many lions were surveyed in total?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
|
Are you on drugs?
Lions can't talk.
|
|
|
|
|
Why has nobody explaind that to our housecats?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Your housecats try to talk to lions?
|
|
|
|
|
No. They all thought they were lions.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Ours thinks he is a tiger. A 17 foot long tiger.
The evidence is against him, but I applaud the enthusiasm.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
My granny yawned , thought about it for a second and said 18.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
18 lions + 1 wolf.
Latest Article - A Concise Overview of Threads
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
|
Surveys are unreliable - this one especially so since everyone is lion...
|
|
|
|
|
So 4 were having an identity crisis?
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
Don't complain about cat and dog hair on the sofa: it's called fur-niture for a reason, isn't it?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
sshhh, better whisker, the wife might hear you
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
So fa so good.
Socialism is the Axe Body Spray of political ideologies: It never does what it claims to do, but people too young to know better keep buying it anyway. (Glenn Reynolds)
|
|
|
|
|
As long as it does not eventuate into fur-nit-urinating
|
|
|
|
|
You just finished watching 'Couching Tiger Hidden Dragon' didn't you?
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|