Enterprise version of FizzBuzz with the right architecture

    Hello habrachitatel. I am an ABBYY blog editor. This morning, developers came to me, brought this text and asked me to print it. I could not think of why this text should appear on a corporate blog, but the developers say that it is funny and will bring joy to people. So be it!

    Tired of full curvature and crutches difficult to support programs? Constantly hear about the correct architecture, but have not seen it? Meet the Enterprise version of FizzBuzz at Github , showing how a serious solution with the right architecture should look like.

    Initially, FizzBuzz is a very simple program, designed as a task during an interview with developers in order to verify that they are generally able to write code. It is usually assumed that the applicant will write a loop with a chain condition inside and in total the program will take about 10 lines. This is suitable for stressful interviews, but is not suitable for a serious business.

    The Enterprise version solves the same problem using 10 interfaces carefully laid out by the com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces package and the number of carefully thought-out classes decomposed by the com.seriouscompany.business.java.fizzbuzz package corresponding to the severity of the task . packagenamingpackage.impl

    Finethe NewLineStringReturner class, which returns a line break, which is then used by the NewLinePrinter line break output mechanism . Such a candidate for an interview is unlikely to write - he does not understand anything in the correct architecture.

    The list of “problems” is separately fine : “XML is not used” , “the repository must be in Perforce” , “I need a SOAP API” , “I need multithreading” and others in the same style. All these problems will probably be solved soon, and we will get the standard of a serious solution with the right architecture.

    At last.

    Also popular now: