The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dsellers (2) [Avatar] Offline
#1
How do I take what used to be lookup tables, and convert this into an object model? Do I use Value Objects or somekind of inheritance scheme? Lets assume that there is no behavior difference for each option either.

Thanks in advance,

Dru
ceracm (113) [Avatar] Offline
#2
Re: Old School Lookup Tables upgraded to POJO
Briefly:

I would map a lookup table (e.g. ORDER_STATUS) to an class (OrderStatus).
A class such as Order would then have a reference to an OrderStatus object.

You might also want to look at the archives of the domain driven design mailing list (http://groups.yahoo.com/group/domaindrivendesign/). There were a couple of threads last year.

Chris
dsellers (2) [Avatar] Offline
#3
Re: Old School Lookup Tables upgraded to POJO
I am asking more of a how do I change from Tables to POJOs? I don't want a lookup table at all in my POJO solution.

Here is what I am doing now.

I have a base class called Standing which I then inherit to get GoodStanding, BadStanding, and UnknownStanding.

I then implement a Factory pattern in the base class [Standing] which generates an instance of [Standing] via static methods. Each static method is also a kind of Singleton pattern to limit the number of there [Standing] classes.

Any thoughts?

Dru
dserodio (4) [Avatar] Offline
#4
Re: Old School Lookup Tables upgraded to POJO
If you don't plan on adding new values to this lookup table, I'd use Java 5 enums.