Sunday, July 22, 2018

Conceptual, Java: Understanding modularization in Programming Code

Objective: Displaying need and benefits of modularized code in Programming
using a sample case scenario- To display first three positive odd integers, and their sum.

Learning: Instead of writing all code within a single Main class, using the Main class as controller class, and different methods of different classes ,specialized to perform specific functions.

Benefits: Code becomes generalized, same program can be used for adding other computational operations like Substraction, Multiplication, Division etc by adding the methods to one class, without other classes and methods getting affected. Similarly, code re-usability, maintainability becomes high.

*****************************************************************
Directory and Package Structure



*****************************************************************
/Java_Core/src/Controller.java




/Java_Core/src/DataProvider.java





/Java_Core/src/Display.java



Result/Output on Running






No comments: