How to encapsulate business logic like com in ASP?
Thanks
How to encapsulate business logic like com in ASP?
Moderator: General Moderators
-
janetsmith
- Forum Newbie
- Posts: 3
- Joined: Wed Jun 21, 2006 3:01 am
-
janetsmith
- Forum Newbie
- Posts: 3
- Joined: Wed Jun 21, 2006 3:01 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I think you're in for more hassle than what it's worth, but okay.
The COM library in PHP is given a GUID or COM name, if you know them. Once you have the COM object created, you have that interface. You can do pretty much whatever that interface can perform in C or VB or ASP.NET. PHP will add some necessary overhead because it's an external system that it has to build an interface to dynamically.
To do all this just to hide a database password seems rather silly. The only reason I can see making another layer between the server and the database is if PHP doesn't have an existing interface to it, which is somewhat hard to believe, but okay. Why not set up a separate, more restricted user for PHP to use directly to this database if PHP does in fact support it? Why lock yourself into COM? Last I checked, it was exclusive to Windows. Not that I have much against Windows, I work on them everyday, it's just not the system to use for a server in my experience.
The COM library in PHP is given a GUID or COM name, if you know them. Once you have the COM object created, you have that interface. You can do pretty much whatever that interface can perform in C or VB or ASP.NET. PHP will add some necessary overhead because it's an external system that it has to build an interface to dynamically.
To do all this just to hide a database password seems rather silly. The only reason I can see making another layer between the server and the database is if PHP doesn't have an existing interface to it, which is somewhat hard to believe, but okay. Why not set up a separate, more restricted user for PHP to use directly to this database if PHP does in fact support it? Why lock yourself into COM? Last I checked, it was exclusive to Windows. Not that I have much against Windows, I work on them everyday, it's just not the system to use for a server in my experience.
-
janetsmith
- Forum Newbie
- Posts: 3
- Joined: Wed Jun 21, 2006 3:01 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I'm not quite sure how to answer that. What do you specifically mean? PHP has extension interfaces where you could create a closer knit interaction between PHP and whatever database you're using, but it again, may be more complicated than what you need. Since you haven't really been specific about the database you're using, it's hard to say what the more simple route would be.janetsmith wrote:Is there any COM counter part in PHP? I mean, does php has something which is similar to com?
PHP can consume COM (and event .Net) components when it's executed on Windows...janetsmith wrote:Is there any COM counter part in PHP? I mean, does php has something which is similar to com?
http://www.php.net/com
http://www.php.net/dotnet
Now, if you want to 'obfuscate' and deliver binaries you can also write your own extension (but most people don't want to load binary-only stuff, and most webhosts simply don't allow it either...)
http://pecl.php.net