Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: How to organize Catalyst stash

by thargas (Deacon)
on Nov 18, 2010 at 14:07 UTC ( #872254=note: print w/replies, xml ) Need Help??

in reply to How to organize Catalyst stash

IMNSHO almost all of those things you call "other information" ought to be part of the payment object, and I would certainly pass that. Textual descriptions should be accessible via the appropriate reference tables using the appropriate methods on your object (specially if it's a DBIx::Class object. The urls can be pulled out of the catalyst context object which your templating system ought to have access to.

I.E. I'd pass the object. I often stash other stuff, but not for the reasons you mention.

CENSORED database dates! As far as I'm concerned, there are only three reasonable forms for a date in a perl program:

  • epoch time (seconds since 1970)
  • an ISO date/time string (you know: YYYY-MM-DDTHH:MM:SSZZ) using as much as you need
  • a DateTime object
Only the first two can be stored in a database. I never use database date formats. I've had to use quite a number of different databases and none of them agree on anything to do with dates/times. And none of them support time-zones. And none of them do what I want. I've had nothing but trouble and wasted time from database date/times. I use an epoch integer or an ISO string, (whichever is appropriate) to store them and convert them to a DateTime object to manipulate them. And it just works. I hate database date/time handling.

Sorry about that. Now I feel better.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://872254]
[1nickt]: I am sure I don't know about most of the stuff that is no longer controlled by humans. I do know that it's past the point of determining consumer pricing and into things that can kill me with blunt force!
[holli]: but is this really a problem 1nickt? Nobody knows how your human taxi drivers brain works either
[holli]: at least for cars, if the ai works better than a human on average, by all means let the machines drive

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-11-21 13:10 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (301 votes). Check out past polls.