views:

370

answers:

2

I have a web application I am working on and so far I have the data access layer finished. Each table has its own class that creates objects of rows of that table, so each object represents a row of a table. The functions each object has is basically CRUD operations.

The question I have is, what is the best way to implement the business logic for the application? I am doing this in PHP so I could just have a file I include that has a bunch of functions but I want to have this organized better. The data access layer is already taking an OO approach so I would like to continue this.

+2  A: 

Normally Java or .Net provides a more organized way to deal with n-tierd architecture model for Web Application. If provide some more information about what language you have created Data Layer than it might help to answer your question in more proper way.

Rachel
+5  A: 

Don't use php for the business logic.

If you're running on a WinTel server with a SQL Server DB, I'd use C# or another language on the .Net framework.

If you're on something like Linux / Oracle / Solaris, with an Oracle / PostgreSQL / MySql DB, I'd use Java, but many on SO would probably push Python.

You can get away with different combinations, but the two I listed will generally make it easy. There are all sorts of best practices for interacting with the DB through an abstaction layer, and either will make it easy for you to expose the functionality from your business layer as REST or SOAP based Web Services. You can consume them in your PHP web UI.

Kaiser Advisor