Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3406980
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:41:41+00:00 2026-05-18T05:41:41+00:00

Going from .Net to PHP because I want to explore the possibilities of the

  • 0

Going from .Net to PHP because I want to explore the possibilities of the language I’m struggling to find some way to autogenerate a DAL. In .Net I’d just use visual studio to generate a datamodel, but how can I do that with PHP and MySQL, so I won’t have to hand-type in all the classes? My current PHP IDE is Aptana.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:41:41+00:00Added an answer on May 18, 2026 at 5:41 am

    If you really want to jump into the idea behind PHP, and not just write .net style code in PHP, you need to move away from the Objects-all-over methods of .net.

    As you’ve noticed, auto-generation of objects isn’t common in PHP. Which means that the solution to the problem should not rely on this.

    Try creating more generic objects and taking advantage of inheritance to avoid object bloat. And more-over try to rely less on data transfer objects and more on creating complete object-as-tool objects.

    You’ll find PHP to be much more of a joy to work with if you escape from the trappings of .net.

    To put that in perspective, I don’t think in the 5 years I have done work in PHP professionally, on big-scale projects like army.mil, have I ever felt the need to create a full-on DAL to get the job done.

    The biggest project I’ve worked on just has a system of model classes each of which carry a list of methods that poll the database for raw data and then pass that data into the final objects. (in this case articles that make up the articles on army.mil)

    There simply isn’t a need for another layer between the model and the data in PHP. It almost always just means more work for no gain.

    There are various reasons why they DO make sense in .net. Not the least of which being that they can be auto-generated trivially and therefore there is almost no time cost in having them.

    That said, when encapsulated within the confines of a framework, DAL begins to make sense again. If your project is basic, I would suggest a framework like CodeIgniter. CI contains a really nice database abstraction system. It forgoes SQL in favor of methods that transform into whatever the particular database you’ve define in the configuration need. This serves the same purpose as a DAL. You are still creating the query in the model, and you still need to be aware of the structure of your database. But despite what .net want’s you to believe, those are really still concerns for .net DALs anyway.

    However, to really GET what PHP is all about, you need to lose the trappings of a framework and work freely. PHP is a hacker language. It affords hacking. (as in seat-of-your-pants programming, not cracking, ok, both..) And that is really what you need to do to understand what the fuss is about.

    Is it a double-edged sword? Totally. But playing fast-and-loose with code is where PHP comes into its own. There is a reason it is the goto language for speedy up-over-night startups.

    Sorry for the long and technically off-topic answer. I hope you can forgive me. You said you have started to use PHP to understand the possibilities of it. If you keep going this way – you’ll decide it is weak, inaccurate, clumsy, and prone to errors; and you’ll miss all the greatness that it offers in its flexibility, extensibility, hack-ability, and spirit. I don’t want you to miss the point of the language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am going to be executing an Update stored procedure from .NET. I want
I'm migrating an e-commerce app from an old php framework to ASP.NET MVC. Some
How much of a performance penalty are you paying when going to .Net from
I am going to pass an variable from asp.net server to the javascript but
I am new in C#, going from PHP. Everything is almost clear, except I
I switched from php to asp.net for a certain project, and i've created a
I am new to the asp.net environment coming from a Lamp background with php
I was going through operator precedence section of php.net and came across this example
I'm using this block of code (mostly copied from a PHP.net comment here -
Going from the example given here... http://ericswann.org/blog/archive/2009/04/06/linq-to-sql-datacontext-provider-revisited.aspx I'm trying to use the datacontext between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.