Comment

Comment by FuzzyDunlop

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.
parent FuzzyDunlop 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton