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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:02:58+00:00 2026-05-25T02:02:58+00:00

I’ve been having trouble finding the right design pattern for the following situation: I’m

  • 0

I’ve been having trouble finding the right design pattern for the following situation:

I’m programming MVC with PHP-Activerecord and a custom framework in an enterprise setting with a SOAP-based SOA. Now I’m trying to access and/or persist basically the same entity over different access layers, depending on the situation. To be a bit more to the point, I will choose an example:

There is a “Member” entity in our system. Now one way to access this member is over a SOAP webservice for which I have written an abstractor:

class Member extends ServiceAbstractor {}

Pro: Live access to the data (there is no other way for me to reach the production database directly).

Con: Pretty slow and I can’t do things like a “JOIN” with other entities or a “SELECT LIKE ‘%member1%'” easily due to the architecture which I cannot change.

Another way is to access the same entity through an older database replication. For that I would use a syntax like this:

class Member extends ActiveRecord\Model { /* Connection 1 */ }

Pro: Blazingly fast and I can do all the fancy stuff described above to do filtering, reporting and aggregation on the Member Data with SQL.

Con: Readonly, data is a little older (but does not really matter for most applications).

Sometimes, I even need to store additional metadata on the member, like who changed something about it for example.

For that I would use a local MySQL database, also with ActiveRecord, but on a different connection:

class Member extends ActiveRecord\Model { /* Connection 2 */ }

Now I would basically love to work with the same entity “Member” in a logical perspective, but obviously I cannot inherit the same class from three different access layers.

Probable use case: Get a member ID via a partial name search from the database copy (SELECT LIKE), then get the “real” member from the webservice, update it with something and then store the editor and last changes for this member in my local database.

Now I could name the respective classes something like “Member”, “MemberCopy” and “MemberMeta” (?), but that leaves me a little unsatisfied, as think I’m talking about the very same entity here.

Does anyone have similar problems and/or some advice on naming or design patterns for this issue?

  • 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-25T02:02:58+00:00Added an answer on May 25, 2026 at 2:02 am

    How about using a logical plain and simple class Member (so not as an entity object) and three different DAO classes (one for WS, one for you replicated DB and the remaining for your local DB) that all take as input and return logical Member objects?

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a jquery bug and I've been looking for hours now, I can't
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.