Hacker News new | past | comments | ask | show | jobs | submit login

It doesn't feel like it's enterprise enough to be realistic.

    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.



You can always use this gem for reference:

https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...


Not enterprise enough, it doesn't implement any interfaces nor extends any generic classes, there also should be some try/catch blocks (what if the bacon isn't fried enough?) and of course several unit tests to guarantee the highest quality sandwich ;)


There isn't even any XML. Not enterprise at all, by definition.


Yeah, we should be able to define types of sandwiches in XML.

What if someone wants a BLT?


Language bashing is what characterizes our industry.

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.


I have the dream that one day we will recognize languages as the tool they are

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.


Criticizing tools is excellent. Deciding about their benefits and limitations, learning about when to use them and when not to use them. Sharing experiences so people can make better choices.

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 about when to use them and when not to use them.

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.


"Learning never to use them is just as legitimate."

Indeed! I would from my experience not use Z80 assembler - though I like it much more than 6502 - and CP/M as an OS for a social media website.

I have the gut feeling though that your comment might be about Java, which might not be warranted. The last company I've worked for makes >$200M in profit a year and will be sold soon for >$1b - based on a Java platform. The next company I worked for was skyrocketing and sold for $200M - based on a Java platform. Both profited from good performance, stability and GC maturity during high periods of growth and load and a good pool of developers during peak hiring times.

But then we might differ in our goals and evaluation criteria, mine is about getting things done to support a business in a sustainable way.


He is not bashing Java per SE but a special kind of Java: Enterprise Java and IMO that deserves a bashing on general principle. Enterprise Java just never seems appropriate.


I don't know if that pun was intentional, but if it was it's absolutely fantastic.

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.


He was bashing a programming language - you call it Enterprise Java - for laughs and karma, not seeing languages as tools you can use based on your judgement. I hope we once will grow beyond bashing.

[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.


HN youngers of today like to bash Enterprise Java, whereas the old guys already have their share of scares from:

Enterprise Clipper

Enterprise C

Enterprise C++

Enterprise Perl

Enterprise TCL

Enterprise insert language here

You just need to let the enterprise architects loose...


I'm probably young enough to have experienced Enterprise PHP, which by all accounts (at least when Symfony2 was just released) seemed like the love-child of Enterprise C++ and Enterprise Java.


But how will some define their superiority? By not using semi-colons?


Hmm... how about...

@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);
	    }

	}


This is much more inspired. I sort of feel sympathetic, because of the potential mental anguish you were likely to have incurred while writing it.


Your use of "new" implies those factories have no interfaces. Normally they would be injected.


Make the comment into Javadoc, add some more modifiers, increase the method names and I think you're well on your way.


Any language has hard time being enterprise.

That what the space station architects are there for.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: