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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:56:36+00:00 2026-06-18T11:56:36+00:00

What is the purpose of using interfaces for domain entities? In our project, we

  • 0

What is the purpose of using interfaces for domain entities?

In our project, we are using interface for domain entities. Inside the interface, there are only getter and setter methods, not even any domain logic.

Is using an interface for entities like this useful? Is this good practice?

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-06-18T11:56:38+00:00Added an answer on June 18, 2026 at 11:56 am

    There are plenty of reasons why it’s a good idea sometimes but it really depends on the scope of the project.

    First of all: your statement “…not even any domain logic.” doesn’t make sense, there can’t be any logic in an interface, interfaces can’t have any logic, only method signatures.

    The main reason why this is done is to support multiple implementations of the domain objects for different uses.

    Reasons why you might want to code your domain objects to interfaces:

    1. Serialization – sometimes you want to create serializable
      versions of your domain objects but don’t want to mix that code up
      with the code you use for your core app. For example, you might have
      an implementation of your Person object that you just use to
      serialize to JSON for your webapp.

    2. Shared API – you might want to distribute a public API version of
      your code that has different implementations of your objects, or you
      might even just want to make the interfaces available to another
      group (or client, or vendor)

    3. Support for a legacy implementation – maybe you have some data in
      an old database that you need to build a connector for that involves
      a different implementation of your domain objects to pull the data
      out.

    4. Testing – having interfaces for your core classes makes unit
      testing a lot easier since you can quickly stub out methods you
      don’t need for testing.

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

Sidebar

Related Questions

What is the purpose of using IBOutlets and IBActions in Xcode and Interface Builder?
Possible Duplicate: The purpose of interfaces continued I just started learning Java not so
I am trying to write a customized threadpool suited to my purpose using pthreads,
What is the purpose of using a selector here? CADisplayLink* displayLink = [CADisplayLink displayLinkWithTarget:self
What is the purpose of using the Boost.MPI library? Does it increase performance? And
What is the purpose of using log4net in NHibernate. As I am a beginner
Basically I am wondering what is the advantage / purpose of using @import to
As far as my understanding after reading and researching, the purpose of using salt
What, exactly, is the purpose of using constants (in PHP)? I understand how they
I'm using a database as a kind of cache - the purpose is to

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.