6

I'm trying to figure out is there a common name for object's interface if our intent is to show that this group of objects has date of creation and tracked dated of last modification. It is an entity in DB.

Have thought about IHasModificationDate and ITrackable. But I'm sure that other programmers outside of the solution where I want to apply this interface would not figure out what does that mean just by reading the name, so I'm looking for something widespread and commonly known.

Is there anything like this for such entities? Maybe something from development patterns?

  • I think that this a valid question. Readability of code, i.e. ease of communication, is an important issue (see Uncle Bob's Clean Code). I do not know a typical name for such an interface. – Bernhard Hiller Feb 19 '18 at 9:41
  • Naming (and cache invalidation) is a really hard thing. Although don't spend too much time trying to reinvent hot water again. Make sure that name has a common, clear meaning between you and your programmers/teams/business analysts etc. Go and focus on delivering solution to their problems rather. :) – kayess Feb 19 '18 at 9:48
  • 1
    @cassandrad cause is: there is no such thing. Every domain and related vocabulary/DSL is kinda unique. – kayess Feb 19 '18 at 10:05
  • 1
    @kayess that's a valid answer, actually. If you'll post it and there will be no better post, I'll mark it as an answer. – cassandrad Feb 19 '18 at 10:12
  • 1
    @BernhardHiller: I'd agree with you, but the OP has dismissed a (reasonable) suggestion with "I would rather discuss with my team what would be more clear for them", defeating most of your argument as to why this is a valid question. As it stands, the only answer to the OP's question is "No.", since OP is not open to actual suggestions. – Flater Feb 19 '18 at 13:49
5

I'm not aware of a common term for such a thing with entities. However, created and modified are two of the three common timestamp metadata for eg files. So I'd suggest using "timestamp" as the basis of such a name, eg ITimeStamp or some such.

  • 1
    Sorry, looks opinion-based to me. Though it is a good suggestion, I would rather discuss with my team what would be more clear for them if there is no standard or common practice to name such things. But it is a good suggestion anyway, so thank you. – cassandrad Feb 19 '18 at 11:35
  • 5
    @cassandrad, ha, clearly I can't win. For once, I thought I'd avoid voting to close this question as being purely opinion based and instead would offer a concrete example of a well known term that's used in other domains for this very purpose. And you accuse me of offering an opinion-based answer and someone else up-votes that comment! Oh the irony. :/ – David Arno Feb 19 '18 at 13:41
  • The irony is that the @yegodm' answer is not opinionated and had no votes :-/. Anyways, I have to say that ITimeStamp might sound confusing at beginning. Took me some seconds to don't think in the data type (maybe because English is not my first language). After that, I have to say that ITimeStamp seems ok. The answer is more useful than a resounding NO, regardless how was stated the question. – Laiv Feb 19 '18 at 20:45
  • I've also used ITimestamp for a similar purpose. While the "correct" Csharp-ish name would be "ITimaStampable", it looks a tad ugly... – T. Sar Feb 21 '18 at 11:43
2

From what I have seen so far Auditable is quite popular. See Spring.Data API for example.

However, if not convinced, you can try searching for a particular name in one of code repositories such as GitHub. Comparing number of occurrences with the same idea behind may give you a clue what is the most common way to denote such entity.

  • 2
    Auditable makes sense, but to me at least it also implies other fields too, eg who modified it and what modification they made, as well as when it happened. But no solution is perfect... – David Arno Feb 19 '18 at 22:51
  • 1
    @DavidArno Agree, I would expect to find user identity there too in most cases. Surprisingly a look from Event Sourcing perspective leads to another perception - out of the whole event sequence the timestamps (plus maybe user identities) of the initial and the most recent events are what is kept. In that sense an Auditable is just a cached aggregation of the event sequence. Not sure if it makes it less "auditable" or more. Maybe it is rather a question how this data is going to be used. – yegodm Feb 20 '18 at 11:02

protected by gnat Feb 21 '18 at 11:36

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.