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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:48:24+00:00 2026-05-11T01:48:24+00:00

An upcoming project of mine is considering a design that involves (what I’m calling)

  • 0

An upcoming project of mine is considering a design that involves (what I’m calling) ‘abstract entity references’. It’s quite a departure from a more common data model design, but it may be necessary to achieve the flexibility we want. I’m wondering if other architects have experience with systems like this and where the caveats are.

The project has a requirement for a to control access to various entities (logically: business objects; physically: database rows) by various people. For example, we might want to create rules like:

  • User Alice is a member of Company Z
  • User Bob is the manager of Group Y, which has users Charlie, Dave, and Eve.
  • User Frank may enter data for [critical business object] X, and also the [critical business objects] in [critical business object group] U.
  • User George is not a member of Company T but may view the reports for Company T.

The idea is that we have a lot of different securable objects, roles, groups, and permissions, and we want a system to handle this. Ideally this system would require little to no coding for new situations once it’s launched; it should be very flexible.

In a ‘traditional’ data design, we might have entities/tables like this:

  • User
  • Company
  • User/Company Cross-Reference
  • UserGroup
  • User/UserGroup Cross-Reference
  • CBO (‘Critical Business Object’)
  • User/CBO Cross-Reference
  • CBOGroup
  • User/CBOGroup Cross-Reference
  • CBO/CBOGroup Cross-Reference
  • ReportAccess, which is a cross-reference between User and Company specifically for access to reports

Note the big number of cross-reference tables. This system isn’t terribly flexible as any time we want to add a new means of access we’d need to introduce a new cross-reference table; that, in turn, means additional coding.

The proposed system has all of the major entities (User, Company, CBO) reference a value in a new table called Entity. (In the code we’d probably make all of these entities subclasses of an Entity superclass). Then there’s two additional tables that reference Entity * Group, which is also an Entity ‘subclass’. * EntityRelation, which is a relation between two entities of any type (including Group). This will probably also have some sort of ‘Relationship Type’ field to explain/qualify the relationship.

This system, at least at first glance, looks like it would meet a lot of our requirements. We might introduce new Entities down the road, but we’d never need to do additional tables to handle the grouping and relationships between these entities, because Group and EntityRelation can already handle that.

I’m concerned, however, whether this might not work very well in practice. The relationships between entities would become very complex and might be very hard for people (users and developers alike) to understand them. Also, they’d be very recursive; this would make things more difficult for our SQL-dependent report writing staff.

Does anyone have experiences with a similar system?

  • 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. 2026-05-11T01:48:24+00:00Added an answer on May 11, 2026 at 1:48 am

    You’re modeling a set of business rules in the real world that are themselves complex. So it’s not surprising that your model is going to be complex no matter how you do it.

    I would recommend that you choose database design that describes the relationships more accurately, instead of trying to be clever. Your clever design may result in fewer tables (though not by an order of magnitude, actually), however you’re trade-off is a lot more application code to manage it.

    For example, you already know that it’s going to cause confusion for users and for report designers. Another weakness is making sure the ‘relationship type’ column contains only meaningful strings for the entities involved in the relationship. E.g. it makes sense to say Bob IsMemberOf UserGroup4, but what does it mean if CBO CanViewReportsOf Bob? Also how do you prevent mutually exclusive conditions, such as Bob IsMemberOf Company1 and Bob IsMemberOf Company2?

    You have to write application code to validate the data before inserting it, and after fetching it (because your code can never be sure another part of the code hasn’t introduced a data integrity bug). You may also need to write application code to perform quality control checks on the whole database, and clean up anomalies when they occur.

    Compare with a database design in which it’s impossible to enter invalid relationships, because the database metadata includes constraints that prevent it. This would simplify your application code a great deal.

    You also identify hierarchical access privileges, like if Bob CanViewReportsOf Company1, then should he be able to view reports of any UserGroup or CBO that is a member of that company? Or do you need to enter a separate row for every entity’s reports Bob can read? These are policy problems, that will exist regardless of which design you use.


    To reply to your comments:

    I can certainly empathize with byzantine exception-cases and evolving requirements making it hard to design simple solutions.

    I worked on systems that tried to model real-world policies that grew so complex that it seemed foolish to try to codify them in software. Ultimately, the client who hired me would have used their money more effectively to hire one or two full-time administrative assistants to track their projects using paper and pencil. New exception cases that took me weeks to implement in software would have taken minutes to describe to the AA.

    Automation is harder than doing things manually. The only way automation is justified is if the information needs to be tracked faster, or with higher volume, than a human could do.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Your domain model is what should understand that there are… May 11, 2026 at 12:35 pm
  • added an answer You can try CSS Tidy: http://csstidy.sourceforge.net/ It is simple yet… May 11, 2026 at 12:35 pm
  • added an answer <div style='float: left;'>Left Div</div> <div style='float: right;'>Right Div</div> May 11, 2026 at 12:35 pm

Related Questions

An upcoming project of mine is considering a design that involves (what I'm calling)
I've got an upcoming project wherein I will need to connect our website (
Premise : The requirements for an upcoming project include the fact that no one
I'm interested in using an Object-Relational Mapping package for an upcoming project. This project
The following have been proposed for an upcoming C++ project. C++ Coding Standards, by
I'm thinking of choosing Adobe AIR as the client-side implementation technology for an upcoming

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.