Announcement Announcement Module
Collapse
No announcement yet.
Reducing cost of programming to interfaces? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reducing cost of programming to interfaces?

    When I did a googlesearch for benefits of using the Spring framework, this bulletpoint comes up under the "Architectural Benefits"

    Spring can facilitate good programming practice by reducing the cost of programming to interfaces, rather than classes, almost to zero.
    Can someone please elaborate about this one? Interface vs. Classes?

    Thanks

  • #2
    Originally posted by vhsjon View Post
    When I did a googlesearch for benefits of using the Spring framework, this bulletpoint comes up under the "Architectural Benefits"



    Can someone please elaborate about this one? Interface vs. Classes?

    Thanks
    So you must be pretty new to OO in general?
    One reason I would give is the fact that an Interface is like a 'Contract' and more then likely is the Contract you will use to code to. With an Interface it provides the rules of what a 'Class' must do/does.

    public interface Shape{
    void draw();
    }

    public class Rectangle implements Shape{
    public void draw(){
    //RECTANGLE Draw logic
    }
    }

    In the long run, it will also allow you to swap in and out implementations of that 'interface' for testing/prototyping engineering exercises that require you to get to Market ASAP.

    A class is the Implementation, as mentioned, its the Hard Coded version of the 'Contract'.

    Comment

    Working...
    X