Welcome Guest, Not a member yet? Register   Sign In
Connection to DB from library
#1

[eluser]tedward[/eluser]
I'm want to stick some functionality into a library. This library needs to connect to the db to populate some arrays. Is it 'correct' to connect to the database directly from the library or should I be creating a model for data access?





more info if you're interested...

I'm using an adjacency list to create a nested category structure. My URLs work fine using the numeric category ID's, but I want to be able to map these ID's to actual category names. This means I'll be able to construct my URLs using the text descriptions of each category. The library will return a map of ID to name and a map of name to ID.

A question a little further into development is going to be - how do I persist these maps so that they don't have to be repopulated with every category browse?


Messages In This Thread
Connection to DB from library - by El Forum - 03-03-2008, 05:21 PM
Connection to DB from library - by El Forum - 03-03-2008, 07:59 PM
Connection to DB from library - by El Forum - 03-10-2008, 06:03 PM
Connection to DB from library - by El Forum - 03-10-2008, 06:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB