Skip to content

MIT LicenseTypeScriptnpm

Core component functionality and infrastructure for the ziegel framework. Provides foundational component model, type conversion, object factories, globalization, and service abstractions for enterprise applications.

Platform Foundation: Essential component infrastructure and cross-cutting concerns for enterprise application development.

🚀 Overview

@breadstone/ziegel-platform provides:

  • Component Model: Interfaces for initializable, startable, stoppable components with property change notifications
  • Type Conversion: Comprehensive type converter system with built-in converters for primitives, arrays, and custom types
  • Object Factories: Object creation patterns with activation handling and dependency injection support
  • Globalization: Culture providers with reactive culture management
  • Date/Time Adapters: Pluggable date/time library support (moment.js, date-fns, luxon)
  • Caching Services: Cache registration and management with weak reference support
  • Decorators: Memoization, notification, and type conversion decorators
  • Interval Management: Aggregated interval handling for periodic operations

📦 Installation

bash
npm install @breadstone/ziegel-platform
# or
yarn add @breadstone/ziegel-platform

🧩 Features & Usage Examples

Component Model

typescript
import { IInitializable, IStartable, IStopable, INotifyPropertyChanged } from '@breadstone/ziegel-platform';

class MyComponent implements IInitializable, IStartable, IStopable {
  initialize(): void {
    // Initialize component
  }

  start(): void {
    // Start component
  }

  stop(): void {
    // Stop component
  }
}

Type Conversion

typescript
import { TypeConverters, ArrayTypeConverter, BooleanTypeConverter } from '@breadstone/ziegel-platform';

// Use built-in converters
const stringArray = TypeConverters.array.convert(['1', '2', '3'], Number);
const boolValue = TypeConverters.boolean.convert('true');

// Register custom converter
TypeConverters.register(MyType, new MyTypeConverter());

Object Factories

typescript
import { ObjectFactory, IObjectFactory } from '@breadstone/ziegel-platform';

const factory = new ObjectFactory();
factory.register('MyService', () => new MyService());
const instance = factory.create<MyService>('MyService');

Globalization

typescript
import { CultureProvider, ICultureProvider } from '@breadstone/ziegel-platform';

const cultureProvider = new CultureProvider();
cultureProvider.setCulture('en-US');
const currentCulture = cultureProvider.getCurrentCulture();

Caching Services

typescript
import { CacheRegistrar, ICacheRegistrar } from '@breadstone/ziegel-platform';

class MyCacheRegistrar extends CacheRegistrar {
  // Implement cache registration logic
}

📚 Package import points

typescript
import {
  // Component Model
  IInitializable,
  INotifyPropertyChanged,
  IStartable,
  IStopable,
  NamedObject,
  isNamedObject,
  ValuedObject,
  isValuedObject,

  // Type Conversion
  ArrayTypeConverter,
  BooleanTypeConverter,
  CssPixelTypeConverter,
  FunctionTypeConverter,
  NullableTypeConverter,
  NumberTypeConverter,
  OptionalTypeConverter,
  StringTypeConverter,
  TypeConverters,
  ITypeConverter,
  ITypeConverterResolverFunc,
  TYPE_CONVERTER_DO_NOTHING,
  TypeConverterDoNothing,

  // Decorators
  Memoize,
  Notify,
  TypeConverter,

  // Exceptions
  TypeConverterException,

  // Factories
  ActivationFailedException,
  IObjectFactory,
  ObjectFactory,

  // Globalization
  CultureProvider,
  ICultureProvider,

  // Reactive Services
  IReactiveCultureProvider,
  ReactiveCultureProvider,
  ReactiveCacheRegistrar,
  IReactiveCacheRegistrar,
  ReactiveCacheChangedReason,

  // Caching Services
  CacheRegistrar,
  WeakCacheRegistrar,
  ICacheRegistrar,

  // Interval Management
  IIntervalAggregator,
  IntervalAggregator,
  IIntervalAction,

  // Date/Time Adapters
  DateAdapter,
  DateTimeDateAdapter,
  IDateAdapter,
  StartOfWeek,
} from '@breadstone/ziegel-platform';

📚 API Documentation

  • @breadstone/ziegel-core: Foundation utilities and type definitions
  • @breadstone/ziegel-platform-*: Specialized platform service packages

License

MIT

Issues

Please report bugs and feature requests in the Issue Tracker


Part of the ziegel Enterprise TypeScript Framework

Released under the MIT License.