× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello All,
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?

The header class would probably have a customer class, which probably has an
address class.
Now would have an item number, description, quantity ordered, quantity
shipped, and price. But would the item number be better as an
ItemNumber.class that contains the description?

Basically, I'm just looking for where do you draw the line in creating
objects?

I have read several books, but all the examples are usually pretty small and
don't really seem to go too deep into this kind of stuff. So any links to
good articles, books, or just advice in general would be appreciated.

--
James R. Perkins

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.