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

  • Home
  • SEARCH
  • 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 549439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:11:05+00:00 2026-05-13T11:11:05+00:00

What is the best approach to take when you are pulling model objects from

  • 0

What is the best approach to take when you are pulling model objects from multiple datasources?

For example I have an application has has some data stored in a mySQL database using hibernate. What If I wanted to store some other objects in EC2 or Google App Engine? I understand that DAO’s abstract the implementation of working with a particular data source, but what about the entities themselves?

At first I thought annotating my entities with jpa annotations was a great solution, but now it seems like i’ve really tied my entities down to a particular implementation. In the case of App Engine for example, some of these annotations make no sense.

It seems like i need a pure POJO class to represent my entities, entirely free of persistence logic. If I wanted to model a Dog for example (yes lame choice, but whatever).
Would it make sense to have an abstract Dog class, then define subclasses to work with particular persistence solutions: HibernateDog, GAEDog, etc.

Thanks.

  • 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-13T11:11:05+00:00Added an answer on May 13, 2026 at 11:11 am

    This is a great question, even if the issue isn’t new. As an industry, we’ve been changing the “conventional wisdom” on this subject frequently over the years. The answers you get today aren’t necessarily what you’d get 5 years ago or 5 years in the future.

    In picturing how I’d like to handle this item, I’m wondering about some things you haven’t stated: is your app the “system of record” for Dog entities? What other subsystems/layers/apps need to know about Dog entities.

    In Java, when you write brand new types like Animal > Dog, you get the following reward: the opportunity to write a whole bunch more code that knows how to interact with Animal objects and Dog objects. I’m less convinced in 2010 that this is a good idea than I was five years ago.

    Are you responsible for designing the database where Dog information is stored? We used to do that all the time, but nowadays I usually find myself integrating with data records that are actually managed by other systems: google APIs, LDAP entities, data warehouses, products like peoplesoft, etc.

    If you’re not in charge of defining what a Dog is and how they interact with the universe, I’d look at a domain-agnostic way to model Dog information in memory. There are tons: XML/DOM, JSON, Map, etc.

    The advantages of moving other people’s data around in these formats are many…

    • you don’t have to write POJOs
    • these are rich in features, documentation, and testing
    • there are numerous existing APIs to transform, manipulate, and serialize these creatures
    • you might get to reuse your view/controller/other code across other domains

    On the other hand… if you are the system of record for Dog data, consider using interfaces instead of abstract classes. Or perhaps interfaces and abstract classes. Java only has single inheritance; tie your view/controller/other code to interfaces to guarentee the most future flexibility.

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

Sidebar

Ask A Question

Stats

  • Questions 295k
  • Answers 295k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Recent versions of IIS and ISA should both operate with… May 13, 2026 at 6:55 pm
  • Editorial Team
    Editorial Team added an answer <% for (int count = 0; count < Model.cartItems.Count; count++… May 13, 2026 at 6:55 pm
  • Editorial Team
    Editorial Team added an answer An empty Binding, without a path, binds directly to the… May 13, 2026 at 6:55 pm

Related Questions

It seems that no matter what my project is, I get through 80% of
I don't think that this is specific to a language or framework, but I
I'm looking into situations in database-oriented web applications when one should rely on client
In a web application that I have run across, I found the following code
Sorry, that's the best subject I can come up with, if I understood the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.