Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Silverstripe for UI, but external database


Reply


2 Posts   1344 Views

Avatar
mikehenrty

Community Member, 2 Posts

17 April 2008 at 9:25am

Hello,

We are implementing a multi-functional data-driven website, and we are planning to use Silverstripe/Sapphire as the CMS/Framework. The issue that we have been struggling with is this:

We already have a fully-fleshed out database schema, and we are planning on implementing a db api that will utilize a mix of stored procedures and php coded business logic to interact with the data. We are doing this so that other applications can interface with the same db, and if we ever change our business rules, we only have to change it in one place. So ideally we want to create our api first, and have our framework interact with this api, or perhaps write SS classes to interact directly with those db tables.

So is Silverstripe the right solution for this situation? As I understand it, the SS db is built using the DataObject classes as definitions, but we want a situation where the framework model interacts with pre-exiting tables. Is this possible in SS?

Also, if SS would be good for this situation, would it be beneficial or necessary to have our api classes implement DataObjectInterface so that Silverstripe can recognize and interact with our objects? Are there any good examples out there showing how to properly implement DataObjectInterface?

Any advice you SS gurus can give me would be greatly appreciated.

Thank you in advance,
Mike

Avatar
Ingo

Forum Moderator, 801 Posts

17 April 2008 at 9:22pm

you'll run into problems when trying to use the sapphire object relational model without the database tables it expects. i think you're on the right track with building the external api first (controller layer), but that's not necessarily connected to building the datalayer without silverstripe. its pretty easy to build a silverstripe datamodel without any views to it :)