Anti-Pattern Name:
ULSAC Anti Pattern
Aliases:
Failed Façade Command Pattern Problem
Context
By trying to make a API method more generalized- you make it too generalized
Forces
- Trying to prevent code change
- Failing to program to interface, in the sense if the implemented class changes it should signal failures else where in the code base.
Solution
Create well defined methods (and names) that explain the exact nature of the method.
Consequences and Resulting Context
- The complexity of the call gets embedded with in a parameter.
- API can’t be readily understood.
- Functionally Overloaded method
- Hard to change.
- Difficult API to use.
What's Wrong with the Solution
Consider the following API which contains self describing methods that can be readily understood and used.
void getCustomerNumber(…);
void getCustomerAddress(…);
void getCustomerTelephone(…);
If a scenario arises in which a developer tries to prevent the API exposed to change by creating an overly generalized method
void getX(…., String actionDesc)
in which the actionDesc contains some sort of internal pseudo language which determines the correct data to return. i.e.
call getCustomerNumber(…) gets replaced with call getX(….,”CustomerNumber”);
call getCustomerNumber(…)+ call getCustomerAddress(…) gets replaced with call getX(….,”CustomerNumber,CustomerAddress”);
Lesson's Learned
Try not to make a single method be all things to everyone. Rely on programming to interface and contractible programming it allows.
Correct Patterns
Author(s):
John Wilson
Date:
01/01/2009
References
Keywords:
Example
ULSAC Anti Pattern
Aliases:
Failed Façade Command Pattern Problem
Context
By trying to make a API method more generalized- you make it too generalized
Forces
- Trying to prevent code change
- Failing to program to interface, in the sense if the implemented class changes it should signal failures else where in the code base.
Solution
Create well defined methods (and names) that explain the exact nature of the method.
Consequences and Resulting Context
- The complexity of the call gets embedded with in a parameter.
- API can’t be readily understood.
- Functionally Overloaded method
- Hard to change.
- Difficult API to use.
What's Wrong with the Solution
Consider the following API which contains self describing methods that can be readily understood and used.
void getCustomerNumber(…);
void getCustomerAddress(…);
void getCustomerTelephone(…);
If a scenario arises in which a developer tries to prevent the API exposed to change by creating an overly generalized method
void getX(…., String actionDesc)
in which the actionDesc contains some sort of internal pseudo language which determines the correct data to return. i.e.
call getCustomerNumber(…) gets replaced with call getX(….,”CustomerNumber”);
call getCustomerNumber(…)+ call getCustomerAddress(…) gets replaced with call getX(….,”CustomerNumber,CustomerAddress”);
Lesson's Learned
Try not to make a single method be all things to everyone. Rely on programming to interface and contractible programming it allows.
Correct Patterns
Author(s):
John Wilson
Date:
01/01/2009
References
Keywords:
Example
by JLW008 January 28, 2009
Get the ULSAC mug.USAC; (United States Auto Club), is an open-wheel auto racing sanctioning body for Mopar Midget National Championship, Sprint Car Series, Silver Crown Series and Ford Focus Series.
by aliaz May 15, 2010
Get the USAC mug.USA Computing Olympiad
Most commonly pronounced as: You-Suck-Oh (or less commonly; You-Sack-Oh)
A 4-hour long, online programming competition for highschool kids where there are four divisions: Bronze, Silver, Gold, and Platinum. Each division features different types of problems, such as sorting, binary search, DP, greedy, graph theory, blah blah, etc.
Helpful Side-note:
Once you reach the 4th division (Platinum), you will realize that the pronounciation of the name makes sense.
Most commonly pronounced as: You-Suck-Oh (or less commonly; You-Sack-Oh)
A 4-hour long, online programming competition for highschool kids where there are four divisions: Bronze, Silver, Gold, and Platinum. Each division features different types of problems, such as sorting, binary search, DP, greedy, graph theory, blah blah, etc.
Helpful Side-note:
Once you reach the 4th division (Platinum), you will realize that the pronounciation of the name makes sense.
Gaddamit, I forgot ONE edge-case for my program, and that killed 8 test cases!! Gaddammit, I missed the USACO Platinum cuttoff by ONE test-case..... Gaddammit, my code won't even compile!!
....I realized that I was a USACO(You-Suck-Oh).
....I realized that I was a USACO(You-Suck-Oh).
by usacokiddo January 11, 2018
Get the USACO mug.A vagina.
by the_real_ian July 3, 2008
Get the unsack mug.Adjective
Definition - An adjective used to describe someone who is a fat bastard. The word is originated from Mongolia in the late 1960's.
Definition - An adjective used to describe someone who is a fat bastard. The word is originated from Mongolia in the late 1960's.
by lordbendtnar September 30, 2018
Get the ulsa mug.EX1: After the new software has been written we will usacate the users, so that they will have a better understanding of the new product.
EX2: I don't need usacation. I am an expert with this tool.
EX3: Please usacate me on this new smart phone.
EX2: I don't need usacation. I am an expert with this tool.
EX3: Please usacate me on this new smart phone.
by NightCastle November 24, 2009
Get the usacate mug.by CCP≠all Chinese. morons January 21, 2021
Get the USACP mug.