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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:36:32+00:00 2026-05-20T14:36:32+00:00

I will be building a system where a particular object will originate from a

  • 0

I will be building a system where a particular object will originate from a web service (SOAP based). It will then be displayed on a web page (via PHP). Under certain circumstances we’ll store a copy with some additional information in a local MySQL database. And from there it will be batch processed into Salesforce CRM (again via PHP). We may also subsequently pull the object out of Salesforce for display online. So alot going on. For the most part the object is the same with each subsequent node in the system likely adding a couple of fields specific to it, unique ids mainly.

I’d initially toyed with the idea of encapsulating all the necessary functionality into the one class in PHP which would deal with reading and writing from each of the appropriate sources. This felt like it was over complicating the class, and not a good approach.

I then looked at having just a container class, with no real functionality attached beyond getters and setters. Then creating separate functionality outside of this to deal with the reading and writing between the different sources, simple enough code although tedious to map between all the different field names across the different sources. There is probably a design pattern or two that apply here, but I’m not familiar with them. Any and all suggestions on how to approach this appreciated.

  • 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-20T14:36:33+00:00Added an answer on May 20, 2026 at 2:36 pm

    I think they may be several ways to handle that. @EGL 2-101 adapter idea is one way to do it.

    Basically, you have several sources, which in O.O. jargon, are different objects. But, you want to treated like if they where a single object.

    You may want to make a single class for each source, test the “connection”, as if each case was the only way you where going to work with. When you have several of that classes, try to make all classes share some interface, methods or properties:

    class AnyConnection 
    {
        public function __construct() {
            // ...
        }
    
        public function read() {
            // ...
        }
    
    } // class
    
    
    class SOAPObject extends AnyConnection
    {
        public function __construct() {
            // ...
        }
    
        public function read() {
            // ...
        }
    
    } // class
    
    class MYSQLObject extends AnyConnection
    {
        public function __construct() {
            // ...
        }
    
        public function read() {
            // ...
        }
    
    } // class
    
    class SalesObject extends AnyConnection
    {
        public function __construct() {
            // ...
        }
    
        public function read() {
            // ...
        }
    
    } // class
    

    Later, use a single class to wrap to all of these source classes.

    class AnyObject extends AnyConnection
    {
        $mySOAPObject;
        $myMYSQLObject;
        $mySalesObject;
    
        public function __construct() {
            // ...
        }
    
        public function read() {
            // ...
        }
    
    } // class
    

    Later, add the code, to select which “connection” you want.

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

Sidebar

Related Questions

I am building an application where a page will load user controls (x.ascx) dynamically
I'm building a part of a system where the user can define views from
I will be building a set of applications. One of these apps is unattended
I'm building a C# application that will monitor a specified directory for changes and
I'm building a class library that will have some public & private methods. I
I'm building a portal that will allow users to upload files. I need to
i am building a webapp that will have notes fields all over the place,
We're building a Silverlight application which will be offered as SaaS. The end product
I'm building a website that will be an open-source, user-contributed content kind of thing,
We are building an enterprise application in which we will incorporate multiple platforms for

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.