Code Explainers

Code explainers tagged #inheritance

java
package com.acme.catalog.persistence;
 
import jakarta.persistence.Column;
import jakarta.persistence.EntityListeners;

Auditing timestamps with a JPA MappedSuperclass in Spring

jpa auditing lifecycle-callbacks
Intermediate 5 steps
python
import os
from datetime import timedelta
 
 

Class-based config in a Flask app factory

configuration app-factory inheritance
Intermediate 7 steps
typescript
import {
  CACHE_MANAGER,
  CacheInterceptor,
} from '@nestjs/cache-manager';

A tenant-aware HTTP cache in NestJS

caching interceptors multi-tenancy
Intermediate 7 steps
ruby
class Employee < ApplicationRecord
  validates :name, presence: true
  validates :salary, numericality: { greater_than: 0 }
 

How STI models share behavior in Rails

single-table-inheritance inheritance method-overriding
Intermediate 8 steps