Skip to content

Instantly share code, notes, and snippets.

@atrauzzi
Last active August 29, 2015 14:02
Show Gist options
  • Save atrauzzi/84fad78e206b1c45c968 to your computer and use it in GitHub Desktop.
Save atrauzzi/84fad78e206b1c45c968 to your computer and use it in GitHub Desktop.
An example of something I saw.
public class BaseServiceClass
{
protected static DictionaryType AllTheDataInTheWorld;
public BaseServiceClass()
{
BaseServiceClass.AllTheDataInTheWorld = new DictionaryType();
}
protected void StoreData(Object literallyAnything)
{
BaseServiceClass.AllTheDataInTheWorld.add(literallyAnything);
}
public DictionaryType GetAllTheDataInTheWorld()
{
return BaseServiceClass.AllTheDataInTheWorld;
}
}
public class Service extends BaseServiceClass
{
public Service(AnotherService dependency)
{
this.dependency = dependency;
super();
}
public MyData DoSomethingINeedDone(OtherData usingThis)
{
// This method obtained by BaseServiceClass.
this.StoreData(this.dependency.doSomethingElse(usingThis));
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment