by FuzzyDunlop · 13y ago · 0 comments
class TwoBaconRashersInsideTwoSlicesOfBreadFactory {
/* Make a sandwich
* <p>
* Construct a foodstuff consisting of two slices
* of bread with two slices of bacon.
* @return TwoBaconRashersInsideTwoSlicesOfBread a sandwich
*/
Public TwoBaconRashersInsideTwoSlicesOfBread getSandwich () {
BaconRasherFactory pig = new BaconRasherFactory();
BaconRasherInstance bacon1 = pig.getBaconRasher();
BaconRasherInstance bacon2 = pig.getBaconRasher();
SliceOfBreadFactory loaf = new SliceOfBreadFactory();
SliceOfBread bread1 = loaf.getSliceOfBread();
SliceOfBread bread2 = loaf.getSliceOfBread();
return new TwoBaconRashersInsideTwoSlicesOfBread(bread1, bacon1, bacon2, bread2);
}
Or something... trying to do Enterprise Java is hard.https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
What if someone wants a BLT?
I have the dream that one day we will recognize languages as the tool they are and be mature enough to chose tools by utility and not by hype, hipness or pop culture and see there benefits and limitations.
We do. They're just terrible tools. Do you think other industries don't criticize their tools? Hell, they have full magazines and reports reviewing and grading them.
The idea that all languages/tools are created equal and just have different use cases is nonsense.
Criticism in this way is rare though. Bashing a language to be cool, be part of the hip crowd, make you feel better about your own choices, bashing languages for karma or laughs, bashing languages you have no experience in comparing it with a language you've used for some weeks is not criticism.
Does it help others? If it does, it is criticism. If it doesn't and only makes you feel good after posting, it's not.
[Edit] And the really sad part is that people make language arguments into people arguments, stereotyping people to make themselves feel better.
Learning never to use them is just as legitimate.
"A place for everything and everything in its place" isn't a law of physics, it's a battle-cry for the obsessive compulsive.
So as to remain on topic: I agree with you but the other side of the coin is that Java the language can't seem to live down Java EE and its culture. It's trying, though. I give particular kudos to the Clojure and Scala communities for helping to rebrand the JVM as something awesome independent of Java. That helped me, at least, to realize that I shouldn't conflate the two in my head.
The only stumbling block I have to get around in my head now when I think JVM is "JVM == long startup times", which is still kinda true but nowhere near as bad as it was.
[Edit] And this is the highest voted comment on a thread about how cool GTA V is to include programming references and how deep their open world is.
Enterprise Clipper
Enterprise C
Enterprise C++
Enterprise Perl
Enterprise TCL
Enterprise insert language here
You just need to let the enterprise architects loose...
@Service public class SandwichFactoryImpl implements SandwichFactory {
@Autowired
public EmptySandwichFactory emptySandwichFactory;
@Autowired
public FoodComponentFactoryFactory foodComponentFactoryFactory;
@Override
public Sandwich makeSandwich(Collection<FoodComponentDescription> foodComponentDescriptions) {
Sandwich sandwich = emptySandwichFactory.newSandwich();
for (FoodComponentDescription foodComponentDescription : foodComponentDescriptions) {
FoodComponentFactory foodFactory = foodComponentFactoryFactory.getFactory(foodComponentDescription.getType());
for (int i = 0; i < foodComponentDescription.getQuantity(); i++) {
sandwich.addFood(foodFactory.create());
}
}
return sandwich;
}
public SandwichDTO makeMyFavoriteSandwich() {
Collection<FoodComponentDescription> components = Lists.newArrayList();
components.add(new FoodComponentDescription(FoodType.BREAD, 1));
components.add(new FoodComponentDescription(FoodType.BACON, 2));
components.add(new FoodComponentDescription(FoodType.BREAD, 1));
return makeSandwich(components);
}
}That what the space station architects are there for.