× 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.



Hi All,
Just looking for a little advice here. I'm trying to (still) wrap my head
around OO design.

I'm working on an application for order entry. I want to take a list of
items and turn them into an order. Not really a big deal, but just the high
level overview.

I have a class Item that looks something like this, mainly the properties is
where my question is.
public class Item {
private boolean active;
private String description;
private int inventoryClass;
private String ean;
private int inventorySubclass;
private String itemNumber;
private String keywords;
private String uom;
private String upc;
private double weight;
...
}

I'm wondering now, if inventoryClass should now be a new class
InventoryClass same with inventorySubclass and uom. Make it more generic has
I could make it more generic like so:
public final class InventoryClass<E> {
private final E inventoryClass;

public InventoryClass(E inventoryClass) {
this.inventoryClass = inventoryClass;
}

public final E getInventoryClass() {
return inventoryClass;
}
}

So, my question is this. Am I heading down the right track? Am I thinking to
RPG/procedural programming like?

Any advice is welcome.

Thanks in advance,
--
James R. Perkins

P.S.
If anybody is interested I have created a List factory class that will
return a generic version of a List without having to infer the generics on
the static factory method.
Example:
List<String> list = newArrayList();
If anybody is interested, I'm willing to share. I'm almost done with a Map
one too.

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.