Abstract development

When developing you have to think in abstract way, because otherwise you would think in a very much single way and that would make any version upgrades bad!!!.. and costly..

e.g. if you are using something like a hash map, and since it implements a interface abstract setup, then if you did some code like

Map mapy = new HashMap<String, Integer>;

and the things like iterators etc would be implemented so the rest of your code you could do something similar to this

foreach (String st in mapy)

but if then in the future if you want to alter to a new improved hash map lets call it the FunckyHashMap, then you just need to

Map mapy = new FunckyHashMap<String, Integer>

since all of the abstraction within both the HashMap and FunckyHashMap will both use the abstract interfaces which means that the foreach code above would still work and you only need to alter one line, e.g. very abstract in the way that things are “talked” to, e.g. the methods/functions are still present and implemented but would be working on different structures within the class/object.

The abstract way of doing things, is just the way to go!!.. create interfaces/abstract classes etc.. and so you will save yourself allot of time in the future.

Leave a Reply

Your email address will not be published. Required fields are marked *