Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Database design and Class::DBI

by enoch (Chaplain)
on Mar 05, 2003 at 20:09 UTC ( #240685=note: print w/replies, xml ) Need Help??

in reply to Database design and Class::DBI

I would have the product object initialize three member vars when it is constructed: $sale_price, $list_price, and $cost_price. Each having the obvious accessors get_sale_price(), get_list_price(), and get_cost_price(). And, I would leave it up to whatever is using the product object to choose which price is appropriate to it's needs.

Is there a specific reason you cannot do it that way? Are applications alrady using the get_price() call and expecting the product object to return the appropriate price?


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://240685]
[LanX]: still can't believe this, must h have been a misunderstanding
[choroba]: fortunately, I haven't the need to verify this
[choroba]: haven't had
[choroba]: but most tourist here are form the US, France, and Russia
[Your Mother]: The best whiskey in Thailand is Vietnamese, is all I know.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2017-02-26 04:55 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (371 votes). Check out past polls.