Some more pain (the non-local local)
-
This anti-pattern is scattered all over the place.
bool bStandardMandatory = false;
bool CheckStandardMandatory()
{
if (cbReportDefinitions.SelectedItem != null)
{
var rep = cbReportDefinitions.SelectedItem;
bStandardMandatory = _presenter.Controller.CheckMandatory(rep, "Standard");
return bStandardMandatory;
}
return false;
}The only other place that touches
bStandardMandatory
:bStandardMandatory = CheckStandardMandatory();
:doh: Please tell me who teaches this stuff to people? Can I cry now? :((
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Edition -
This anti-pattern is scattered all over the place.
bool bStandardMandatory = false;
bool CheckStandardMandatory()
{
if (cbReportDefinitions.SelectedItem != null)
{
var rep = cbReportDefinitions.SelectedItem;
bStandardMandatory = _presenter.Controller.CheckMandatory(rep, "Standard");
return bStandardMandatory;
}
return false;
}The only other place that touches
bStandardMandatory
:bStandardMandatory = CheckStandardMandatory();
:doh: Please tell me who teaches this stuff to people? Can I cry now? :((
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth EditionWhat about the implementation in _presenter.Controller? Is it:
bool bMandatory = false;
bool CheckMandatory()
{
if (someCondition)
{
...;
bMandatory = _someMember.CheckMandatory(..., "Standard");
return bMandatory;
}
return false;
}with only one other place that touches
bMandatory
:bMandatory = CheckMandatory();
-
What about the implementation in _presenter.Controller? Is it:
bool bMandatory = false;
bool CheckMandatory()
{
if (someCondition)
{
...;
bMandatory = _someMember.CheckMandatory(..., "Standard");
return bMandatory;
}
return false;
}with only one other place that touches
bMandatory
:bMandatory = CheckMandatory();
Bernhard Hiller wrote:
What about the implementation in _presenter.Controller?
Quite possible, but now I am too scared to look! :^) Edit: Not quite as bad (but 99% there)!
bool bStandardMandatory = false;
internal bool CheckMandatory(object rep, string entityname)
{
return bStandardMandatory = ReportConfigurationService.CheckMandatory(DataContext.DataContext, rep, entityname);
}With nothing else touching
bStandardMandatory
... :omg: I guess now you want to know what that one's implementation looks like? :) Edit 2: I had to ask... well here it is.public bool CheckMandatory(dboDataContext datacontext, object rpt, string entityname)
{
return ReportInterface.CheckMandatory(datacontext, rpt, entityname);
}At least no useless non-local local here. I wonder how it goes on... Edit 3: Finally we have some code at that destination!
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Editionmodified on Monday, October 18, 2010 2:56 AM
-
This anti-pattern is scattered all over the place.
bool bStandardMandatory = false;
bool CheckStandardMandatory()
{
if (cbReportDefinitions.SelectedItem != null)
{
var rep = cbReportDefinitions.SelectedItem;
bStandardMandatory = _presenter.Controller.CheckMandatory(rep, "Standard");
return bStandardMandatory;
}
return false;
}The only other place that touches
bStandardMandatory
:bStandardMandatory = CheckStandardMandatory();
:doh: Please tell me who teaches this stuff to people? Can I cry now? :((
xacc.ide
IronScheme - 1.0 RC 1 - out now!
((λ (x) `(,x ',x)) '(λ (x) `(,x ',x))) The Scheme Programming Language – Fourth Edition