Real computer projects are made of many classes. • Cannot remember all the details of a complex problem • We “Divide & Conquer” by breaking up the problem • By splitting the problem up into simpler sub-problems we reduce the complex problem into a group of simple problems that we can solve.
A Car is made of many parts • A company designing a car will need to think about body shape, seats, engine, wheels. • The engine will need to be designed in more detail • Spark plugs will need to be designed • Tyres will also need to be designed. • Designer of the wheel will just take the minimum information about the tyres that are needed for the design. • Likewise the engine design will only take the specification of the spark plug • This is called abstraction
Cars are manufactured by modularisation • Since no-one can keep all the details required to construct a car, it is divided into modules small enough to handle. • Modularisation and Abstraction complement each other • Modularisation breaks the problem into manageable parts • Abstraction is the ability to ignore the details for the big picture.
Modularisation in Java is the creation of objects. Abstraction is a hierarchy of objects