@breadstone/ziegel-platform
v0.0.9
Published
Includes core functionalaty. its shared betwenn all component packages.
Downloads
517
Readme
@breadstone/ziegel-platform
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
npm install @breadstone/ziegel-platform
# or
yarn add @breadstone/ziegel-platform🧩 Features & Usage Examples
Component Model
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
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
import { ObjectFactory, IObjectFactory } from '@breadstone/ziegel-platform';
const factory = new ObjectFactory();
factory.register('MyService', () => new MyService());
const instance = factory.create<MyService>('MyService');Globalization
import { CultureProvider, ICultureProvider } from '@breadstone/ziegel-platform';
const cultureProvider = new CultureProvider();
cultureProvider.setCulture('en-US');
const currentCulture = cultureProvider.getCurrentCulture();Caching Services
import { CacheRegistrar, ICacheRegistrar } from '@breadstone/ziegel-platform';
class MyCacheRegistrar extends CacheRegistrar {
// Implement cache registration logic
}📚 Package import points
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
For detailed API documentation, visit: API Docs
Related Packages
- @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
