|
Hello All,An interface is a _contract_. The implementation guarantees to have what the interface says, and the code in which it is used is guaranteed that the object is "in order" and can be used without checking all kinds of things.
This might not be the best place to post this, but since at least some of
you probably come from a procedural programming background you might be able
to help me understand this.
I have been working with Java for a little while now and I'm starting to use
it more and more. I have a slight disconnect when it comes to understanding
a few things.
1. When to create an Object? (e.g. a Customer.class would probably have a
Address.class)
2. When to use an interface over just using a class?
Take for example a customer order. A normal customer order would consist of
a header and a detail.
So, would you create a header class and a detail class, then an order class
that consists of a header and an array of detail? Or do you just create an
order class that would have header information and detail arrays?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.