|
That is the rub - auto-mapping and serialization of the business objects is the issue. Business objects shouldn't be persisted - there should be a specific shearing layer with its own classes for that (a repository or data access layer for example).
|
|
|
|
|
Just like Sentenryu, constructor will be just as good for immutability.
Better, they are overridable if you create a subclass
And before you said 'haha, this prevent subclassing', there is the 'final' keyworkd for that!
|
|
|
|
|
The only language I can think of that the create method would be useful is C++ for use with templates and pointers, but it would have to be an instance method, so you can take a Base* and create an instance of the right derived type.
I guess it could be useful for the same reason on C# or Java, but i see less reason to use it on those languages.
|
|
|
|
|
Quote: New PM!
He has strong (& abysmal) opinions about development. Project Manager? The PMs I have worked with never knew anything about code. Their job was to manage the customer mostly.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Right, sounds more like a micro-manager to me.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Haha, that must be it! ^^
|
|
|
|
|
Micro-manager ?
Had my fare share of those. The funny thing is that I wouldn't mind (that much) if anything they'd said made sence, but mostly it's just jibberish and buzz words coming out...
They shouldn't interfere with your coding though. Can you escalate?
|
|
|
|
|
I think he is trying to teach me how to improve upon an ASP.NET MVC application using 1995 Java techniques!
|
|
|
|
|
My boss said we can relocate you somewhere else if need be....
But I quite like the other people!
And I found the way to cope, just ignore his gibberish! Luckily it's possible! ^^
|
|
|
|
|
Then you´re a better man than I am .
|
|
|
|
|
private string Format(string data, Dictionary<string, string> properties)
{
foreach (string key in properties.Keys)
{
data = data.Replace(key, data);
}
return data;
}
.
|
|
|
|
|
Unless it's purpose was to waste time and memory?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
|
Would have been better as an extension method.
Don't comment your code - it was hard to write, it should be hard to read!
|
|
|
|
|
using (SqlConnection Connection = Sql.GetConnectionString())
{
using (SqlCommand command = new SqlCommand("*****", Connection))
{
command.CommandType = CommandType.StoredProcedure;
try
{
Connection.Open();
intID = (int) command.ExecuteScalar();
}
catch (Exception ex)
{
command.Dispose();
Connection.Close();
Connection.Dispose();
}
finally
{
command.Dispose();
Connection.Close();
Connection.Dispose();
}
}
}
___ ___ ___
|__ |_| |\ | | |_| \ /
__| | | | \| |__| | | /
modified 2-Apr-14 9:06am.
|
|
|
|
|
Well, at least they're being sure the stuff is disposed of.
Too bad they also disposed of their ability to understand how Try/Catch works too.
|
|
|
|
|
Dave Kreskowiak wrote: disposed of their ability to understand how Try/Catch works and using also...
|
|
|
|
|
Pretty clear developer intent.
Yet it's also a scream for help.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
Bloody beginners!
using (SqlConnection Connection = Sql.GetConnectionString())
{
using (SqlCommand command = new SqlCommand("*****", Connection))
{
command.CommandType = CommandType.StoredProcedure;
try
{
Connection.Open();
intID = (int) command.ExecuteScalar();
command.Dispose();
Connection.Close();
Connection.Dispose();
}
catch (Exception ex)
{
intID = 22;
command.Dispose();
Connection.Close();
Connection.Dispose();
}
finally
{
command.Dispose();
Connection.Close();
Connection.Dispose();
}
}
}
Also a great idea that Sql.GetConnectionString() does not return a string but a SqlConnection .
|
|
|
|
|
Maybe they came from Java and someone told them "you have to use using".
So they put a using in there...
|
|
|
|
|
|
So...did you buy anything from them?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I just wanted to know what a particular component does. I'm not looking to buy more.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
I would : they have obviously put all the workforce in the product, not in the marketing/website.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|