Results 1 to 7 of 7
  1. #1
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142

    Table Inheritance and Abstraction Layers

    I'm curious to know if anyone here is ever implemented inheritance concepts in a ms access db design before?



    How'd it work out? More trouble than it's worth?

    Did you create an abstraction layer with queries between the tables and UI?

    Generally speaking is an abstraction layer a good thing or a bad thing for maintainability?

    I'm playing around with this idea right now and while it's neat it's one of those things that I can tell I'm probably going to have no idea what the hell I was thinking 6 months from now...

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Sorry to say I have no idea about what you are thinking now
    Perhaps you can dumb this down a little to make it easier to understand!
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Refer to this documentation for python's sqlalchemy orm library on the subject: https://docs.sqlalchemy.org/en/20/orm/inheritance.html

    What I mean be table inheritance is like class inheritance in object oriented programming. Given a row in a table represents the properties of an object, what if you have an object that's basically the same but needs a few more properties to be fully represented?

    For example you could have a table called [animal] which has a few basic fields for properties that all animals have, then you could have a table called [tiger] that is 1-to-1 with the animal table, so it "inherits" animal base properties and adds fields for specific to a tiger's properties. You could have another one for [octopus], [bird], etc. This is the 'joined table inheritance' mentioned in the docs linked above.

    What I mean by an abstraction layer in queries is you have a queries called [qry_tiger], [qry_octopus], etc that pulls all the "inherited" tables together and then all of your forms/UI are based off of these queries.

    Maybe you have a denormalized flat table that has fields for all the properties of the types of [animals] that you might need, ie "single table inheritance", and you create an abstraction layer of queries [qry_tiger], [qry_octopus], etc. that breaks the relevant fields out and you build forms specific to tigers or octopi and so on.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Perhaps this link has info related to your post.
    You may also find something in this thread.
    Or here

  5. #5
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    The data layer answers to different rules than the object layer. You need to design the data layer for fast query execution. In your case this could be a table 'Animals' with all fields for all animals, a table AnimalTypes with values as 'Tiger', 'Wolf', a table AnimalProperties with the fields ID, animaltype, and Property, and a table AnimaPropertyValues with the fields Animal (=ID from table Animals), AnimalProperty (=ID from table AnimalProperty) and PropertyValue (= the value for that animal for that property).
    Above that layer you can create a query layer and class modules with a class for each animal type.

  6. #6
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    So for the sake of speed and efficiency would you say you might favor designing more obscure or abstract table structures/relationships at the expense of clarity?

  7. #7
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    The more obscure/abstract normalized structure is mostly to ensure correct data retrieval, not running into trouble when creating queries and preventing redundant data.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Report Drill Down Multiple Layers
    By whitechr in forum Reports
    Replies: 2
    Last Post: 06-15-2021, 04:53 PM
  2. Replies: 10
    Last Post: 08-24-2020, 09:01 PM
  3. List value query - 2 layers deep
    By blargh88 in forum Queries
    Replies: 12
    Last Post: 02-22-2012, 03:22 PM
  4. Replies: 3
    Last Post: 01-17-2011, 01:48 AM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums