Help to rewrite the whole SQL Database?
#16
(2012-04-09, 21:19)topfs2 Wrote:
(2012-04-09, 15:03)da-anda Wrote: sorry - I haven't read the 4 huge posts of you guys yet, I just wanted to mention that I'd really love to work on a new DB layout. Developing domain driven (DDD) for some years now, I have a pretty good sense for abstracting and generalizing data. I also know about the requirements of initially simple queries for basic media listing + on demand queries. The php framework I'm coding with has a nice concept for this - it's called "lazy loading". Basically you have a "repository" (a class that returns objects of a certain type, abstracting the sql stuff from the application layer) that fetches raw DB data from the primary object table and returns it as ready to use objects. Object properties that are relations to other tables can either be loaded eager (so instantly on creating the object by triggering subqueries) or lazy, which means that the object property itself only holds a proxy class that will load the according data/object on demand/first use. This is pretty nice to work with and I think that's also how it should work in XBMC on the long run, because it would easily allow the desired generalized DB schema.

Must say that having a way to handle linking to other databases is a great thing, that would allow us to for example link a fileitem to a movie on themoviedb and thus just have a form of cache which acts themoviedb, that way we could schedule updates from themoviedb as needed but also if a fileitem is wrongly classed as a movie we can just remove that link.

da-anda is talking about an Object-relational mapper (I'm guessing doctrine, which is a php implementation of the java orm), I'm pretty sure there must be good c++ implementations around. However, I don't really see how that helps with linking to other databases...
Reply


Messages In This Thread
RE: Help to rewrite the whole SQL Database? - by sebak - 2012-04-10, 13:50
Logout Mark Read Team Forum Stats Members Help
Help to rewrite the whole SQL Database?2