views:

12

answers:

1

I have a site built with cakephp (1.3), where users can manage lists of items.

I now want to develop a facebook app that will work with the data of my web-based site. The facebok-app is to replicate many of the web-site's functionality (basic CRUD and more), so I would like to reuse as much code as I can from my current cake- just use a different layout, or maybe change the views.

My question is: from a software design perspective, what's the best way to go about that? Some ideas I had in mind are:

  • Add branching code in my actions to behave differently if it's running as facebook iframe
  • externalize lots of action-logic into libs, and create different actions for the facebook app which will reuse those libs, as well as views

Would love if you can come up with other ideas.

Thanks!

+1  A: 

Rather than munging your core functions, could you not develop a generic 'hook' in system and then develop your facebook functionality in a separate API to take advantage of the hooks, this would be more scalable long term and keep both apps logic separate.

woodscreative
woodcreative, can you further explain what you mean by "seperate api"?
azv
Well if you have an app that is running in its current state adding code specific to facebook into your app would be pretty hard to undo. Maybe I don't understand the purpose or importance of your Facebook integration to your current application. Will one exist without the other?
woodscreative
No- facebook app can't exist w/o cakephp site. Regarding munging the code- that's exactly what I would hate to do, for the facebook app, so I'm shopping around for ideas that would make things look nicer
azv

related questions