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 7673677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:34:02+00:00 2026-05-31T16:34:02+00:00

I have written a PHP application that uses Objects heavily. Added, deleting, updating etc..

  • 0

I have written a PHP application that uses Objects heavily. Added, deleting, updating etc.. rows in my database. I want it to conform to a easy to read standard for future developers and the possibility of open sourcing the code. Which is easier for you? Assume variables are public.

$tablename = new tablenameClass;
result= $tablename->addrow($POST,$AdditionalStuff,$Settings);

or using the object

$tablename = new tablenameClass;
$tablename->AdditionalStuff = array(whatever);
$tablename->Settings = array(settings);
result= $tablename->addrow($POST);

So this question is more about convention then anything else. Sorry I know the code is broken.

I really like the way jQuery does it.

tablename(array({
    thing:stuff,
    thing2:stuff2
    }));
  • 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-31T16:34:03+00:00Added an answer on May 31, 2026 at 4:34 pm

    The 2nd example is much easier to read and understand…AdditionalStuff and Settings are defined right there.

    The 2nd example also seems to fall in line with high cohesion as you have members supporting a well-focused role and/or responsibility.

    Your 1st example has a method that accepts multiple arguments, which isn’t necessarily bad, but in the 2nd example, this same method is reduced to only needing one argument which seems to promote more cohesion in the method.

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

Sidebar

Related Questions

I have an application written in PHP that uses a COM dll written in
I have a PHP application that is written with Zend Framework. It uses Phing
I have a small AJAX application, written in PHP that I did not secure
I have written a php e-mail processing client that uses the IMAP protocol. I
I have written a small chat app that uses mysql + php to facilitate
I have written an application that uses the Tinymce editor. The administrator can create
I have written a Java application that runs from the command line. I want
I have a web application written in PHP. It uses MySQL for data storage.
I have written a PHP application that broadcasts a voice message to phone numbers
I'm adding new features to a legacy application written in PHP that uses an

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.