exonware-xwsystem 0.1.0.1__py3-none-any.whl → 0.1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. exonware/__init__.py +2 -1
  2. exonware/conf.py +2 -2
  3. exonware/xwsystem/__init__.py +115 -43
  4. exonware/xwsystem/base.py +30 -0
  5. exonware/xwsystem/caching/__init__.py +39 -13
  6. exonware/xwsystem/caching/base.py +24 -6
  7. exonware/xwsystem/caching/bloom_cache.py +2 -2
  8. exonware/xwsystem/caching/cache_manager.py +2 -1
  9. exonware/xwsystem/caching/conditional.py +2 -2
  10. exonware/xwsystem/caching/contracts.py +85 -139
  11. exonware/xwsystem/caching/decorators.py +6 -19
  12. exonware/xwsystem/caching/defs.py +2 -1
  13. exonware/xwsystem/caching/disk_cache.py +2 -1
  14. exonware/xwsystem/caching/distributed.py +2 -1
  15. exonware/xwsystem/caching/errors.py +2 -1
  16. exonware/xwsystem/caching/events.py +110 -27
  17. exonware/xwsystem/caching/eviction_strategies.py +2 -2
  18. exonware/xwsystem/caching/external_caching_python.py +701 -0
  19. exonware/xwsystem/caching/facade.py +253 -0
  20. exonware/xwsystem/caching/factory.py +300 -0
  21. exonware/xwsystem/caching/fluent.py +14 -12
  22. exonware/xwsystem/caching/integrity.py +21 -6
  23. exonware/xwsystem/caching/lfu_cache.py +2 -1
  24. exonware/xwsystem/caching/lfu_optimized.py +18 -6
  25. exonware/xwsystem/caching/lru_cache.py +7 -4
  26. exonware/xwsystem/caching/memory_bounded.py +2 -2
  27. exonware/xwsystem/caching/metrics_exporter.py +2 -2
  28. exonware/xwsystem/caching/observable_cache.py +2 -2
  29. exonware/xwsystem/caching/pluggable_cache.py +2 -2
  30. exonware/xwsystem/caching/rate_limiter.py +2 -2
  31. exonware/xwsystem/caching/read_through.py +2 -2
  32. exonware/xwsystem/caching/secure_cache.py +81 -28
  33. exonware/xwsystem/caching/serializable.py +9 -7
  34. exonware/xwsystem/caching/stats.py +2 -2
  35. exonware/xwsystem/caching/tagging.py +2 -2
  36. exonware/xwsystem/caching/ttl_cache.py +4 -3
  37. exonware/xwsystem/caching/two_tier_cache.py +6 -3
  38. exonware/xwsystem/caching/utils.py +30 -12
  39. exonware/xwsystem/caching/validation.py +2 -2
  40. exonware/xwsystem/caching/warming.py +6 -3
  41. exonware/xwsystem/caching/write_behind.py +15 -6
  42. exonware/xwsystem/config/__init__.py +11 -17
  43. exonware/xwsystem/config/base.py +5 -5
  44. exonware/xwsystem/config/contracts.py +93 -153
  45. exonware/xwsystem/config/defaults.py +3 -2
  46. exonware/xwsystem/config/defs.py +3 -2
  47. exonware/xwsystem/config/errors.py +2 -5
  48. exonware/xwsystem/config/logging.py +12 -8
  49. exonware/xwsystem/config/logging_setup.py +3 -2
  50. exonware/xwsystem/config/performance.py +1 -46
  51. exonware/xwsystem/config/performance_modes.py +9 -8
  52. exonware/xwsystem/config/version_manager.py +1 -0
  53. exonware/xwsystem/config.py +27 -0
  54. exonware/xwsystem/console/__init__.py +53 -0
  55. exonware/xwsystem/console/base.py +133 -0
  56. exonware/xwsystem/console/cli/__init__.py +61 -0
  57. exonware/xwsystem/{cli → console/cli}/args.py +27 -24
  58. exonware/xwsystem/{cli → console/cli}/base.py +18 -87
  59. exonware/xwsystem/{cli → console/cli}/colors.py +15 -13
  60. exonware/xwsystem/console/cli/console.py +98 -0
  61. exonware/xwsystem/{cli → console/cli}/contracts.py +51 -69
  62. exonware/xwsystem/console/cli/defs.py +87 -0
  63. exonware/xwsystem/console/cli/encoding.py +69 -0
  64. exonware/xwsystem/{cli → console/cli}/errors.py +8 -3
  65. exonware/xwsystem/console/cli/event_logger.py +166 -0
  66. exonware/xwsystem/{cli → console/cli}/progress.py +25 -21
  67. exonware/xwsystem/{cli → console/cli}/prompts.py +3 -2
  68. exonware/xwsystem/{cli → console/cli}/tables.py +27 -24
  69. exonware/xwsystem/console/contracts.py +113 -0
  70. exonware/xwsystem/console/defs.py +154 -0
  71. exonware/xwsystem/console/errors.py +34 -0
  72. exonware/xwsystem/console/event_logger.py +385 -0
  73. exonware/xwsystem/console/writer.py +132 -0
  74. exonware/xwsystem/contracts.py +28 -0
  75. exonware/xwsystem/data_structures/__init__.py +23 -0
  76. exonware/xwsystem/data_structures/trie.py +34 -0
  77. exonware/xwsystem/data_structures/union_find.py +144 -0
  78. exonware/xwsystem/defs.py +17 -0
  79. exonware/xwsystem/errors.py +23 -0
  80. exonware/xwsystem/facade.py +62 -0
  81. exonware/xwsystem/http_client/__init__.py +22 -1
  82. exonware/xwsystem/http_client/advanced_client.py +8 -5
  83. exonware/xwsystem/http_client/base.py +3 -2
  84. exonware/xwsystem/http_client/client.py +7 -4
  85. exonware/xwsystem/http_client/contracts.py +42 -56
  86. exonware/xwsystem/http_client/defs.py +2 -1
  87. exonware/xwsystem/http_client/errors.py +2 -1
  88. exonware/xwsystem/http_client/facade.py +156 -0
  89. exonware/xwsystem/io/__init__.py +22 -3
  90. exonware/xwsystem/io/archive/__init__.py +8 -2
  91. exonware/xwsystem/io/archive/archive.py +1 -1
  92. exonware/xwsystem/io/archive/archive_files.py +4 -7
  93. exonware/xwsystem/io/archive/archivers.py +120 -10
  94. exonware/xwsystem/io/archive/base.py +4 -5
  95. exonware/xwsystem/io/archive/codec_integration.py +1 -2
  96. exonware/xwsystem/io/archive/compression.py +1 -2
  97. exonware/xwsystem/io/archive/facade.py +263 -0
  98. exonware/xwsystem/io/archive/formats/__init__.py +2 -3
  99. exonware/xwsystem/io/archive/formats/brotli_format.py +20 -7
  100. exonware/xwsystem/io/archive/formats/lz4_format.py +20 -7
  101. exonware/xwsystem/io/archive/formats/rar.py +11 -5
  102. exonware/xwsystem/io/archive/formats/sevenzip.py +12 -6
  103. exonware/xwsystem/io/archive/formats/squashfs_format.py +1 -2
  104. exonware/xwsystem/io/archive/formats/tar.py +52 -7
  105. exonware/xwsystem/io/archive/formats/wim_format.py +11 -5
  106. exonware/xwsystem/io/archive/formats/zip.py +1 -2
  107. exonware/xwsystem/io/archive/formats/zpaq_format.py +1 -2
  108. exonware/xwsystem/io/archive/formats/zstandard.py +20 -7
  109. exonware/xwsystem/io/base.py +119 -115
  110. exonware/xwsystem/io/codec/__init__.py +4 -2
  111. exonware/xwsystem/io/codec/base.py +19 -13
  112. exonware/xwsystem/io/codec/contracts.py +59 -2
  113. exonware/xwsystem/io/codec/registry.py +67 -21
  114. exonware/xwsystem/io/common/__init__.py +1 -1
  115. exonware/xwsystem/io/common/atomic.py +29 -16
  116. exonware/xwsystem/io/common/base.py +11 -10
  117. exonware/xwsystem/io/common/lock.py +6 -5
  118. exonware/xwsystem/io/common/path_manager.py +2 -1
  119. exonware/xwsystem/io/common/watcher.py +1 -2
  120. exonware/xwsystem/io/contracts.py +301 -433
  121. exonware/xwsystem/io/contracts_1.py +1180 -0
  122. exonware/xwsystem/io/data_operations.py +19 -20
  123. exonware/xwsystem/io/defs.py +4 -3
  124. exonware/xwsystem/io/errors.py +3 -2
  125. exonware/xwsystem/io/facade.py +87 -61
  126. exonware/xwsystem/io/file/__init__.py +1 -1
  127. exonware/xwsystem/io/file/base.py +8 -9
  128. exonware/xwsystem/io/file/conversion.py +2 -3
  129. exonware/xwsystem/io/file/file.py +61 -18
  130. exonware/xwsystem/io/file/paged_source.py +8 -8
  131. exonware/xwsystem/io/file/paging/__init__.py +1 -2
  132. exonware/xwsystem/io/file/paging/byte_paging.py +4 -5
  133. exonware/xwsystem/io/file/paging/line_paging.py +2 -3
  134. exonware/xwsystem/io/file/paging/record_paging.py +2 -3
  135. exonware/xwsystem/io/file/paging/registry.py +1 -2
  136. exonware/xwsystem/io/file/source.py +13 -17
  137. exonware/xwsystem/io/filesystem/__init__.py +1 -1
  138. exonware/xwsystem/io/filesystem/base.py +1 -2
  139. exonware/xwsystem/io/filesystem/local.py +3 -4
  140. exonware/xwsystem/io/folder/__init__.py +1 -1
  141. exonware/xwsystem/io/folder/base.py +1 -2
  142. exonware/xwsystem/io/folder/folder.py +16 -7
  143. exonware/xwsystem/io/indexing/__init__.py +14 -0
  144. exonware/xwsystem/io/indexing/facade.py +443 -0
  145. exonware/xwsystem/io/path_parser.py +98 -0
  146. exonware/xwsystem/io/serialization/__init__.py +21 -3
  147. exonware/xwsystem/io/serialization/auto_serializer.py +146 -20
  148. exonware/xwsystem/io/serialization/base.py +84 -34
  149. exonware/xwsystem/io/serialization/contracts.py +50 -73
  150. exonware/xwsystem/io/serialization/defs.py +2 -1
  151. exonware/xwsystem/io/serialization/errors.py +2 -1
  152. exonware/xwsystem/io/serialization/flyweight.py +154 -7
  153. exonware/xwsystem/io/serialization/format_detector.py +15 -14
  154. exonware/xwsystem/io/serialization/formats/__init__.py +8 -5
  155. exonware/xwsystem/io/serialization/formats/binary/bson.py +15 -6
  156. exonware/xwsystem/io/serialization/formats/binary/cbor.py +5 -5
  157. exonware/xwsystem/io/serialization/formats/binary/marshal.py +5 -5
  158. exonware/xwsystem/io/serialization/formats/binary/msgpack.py +5 -5
  159. exonware/xwsystem/io/serialization/formats/binary/pickle.py +5 -5
  160. exonware/xwsystem/io/serialization/formats/binary/plistlib.py +5 -5
  161. exonware/xwsystem/io/serialization/formats/database/dbm.py +7 -7
  162. exonware/xwsystem/io/serialization/formats/database/shelve.py +7 -7
  163. exonware/xwsystem/io/serialization/formats/database/sqlite3.py +7 -7
  164. exonware/xwsystem/io/serialization/formats/tabular/__init__.py +27 -0
  165. exonware/xwsystem/io/serialization/formats/tabular/base.py +89 -0
  166. exonware/xwsystem/io/serialization/formats/tabular/csv.py +319 -0
  167. exonware/xwsystem/io/serialization/formats/tabular/df.py +249 -0
  168. exonware/xwsystem/io/serialization/formats/tabular/excel.py +291 -0
  169. exonware/xwsystem/io/serialization/formats/tabular/googlesheets.py +374 -0
  170. exonware/xwsystem/io/serialization/formats/text/__init__.py +1 -1
  171. exonware/xwsystem/io/serialization/formats/text/append_only_log.py +5 -7
  172. exonware/xwsystem/io/serialization/formats/text/configparser.py +5 -5
  173. exonware/xwsystem/io/serialization/formats/text/csv.py +7 -5
  174. exonware/xwsystem/io/serialization/formats/text/formdata.py +5 -5
  175. exonware/xwsystem/io/serialization/formats/text/json.py +27 -18
  176. exonware/xwsystem/io/serialization/formats/text/json5.py +8 -4
  177. exonware/xwsystem/io/serialization/formats/text/jsonlines.py +18 -14
  178. exonware/xwsystem/io/serialization/formats/text/multipart.py +5 -5
  179. exonware/xwsystem/io/serialization/formats/text/toml.py +8 -6
  180. exonware/xwsystem/io/serialization/formats/text/xml.py +25 -20
  181. exonware/xwsystem/io/serialization/formats/text/yaml.py +8 -6
  182. exonware/xwsystem/io/serialization/parsers/__init__.py +3 -2
  183. exonware/xwsystem/io/serialization/parsers/base.py +6 -5
  184. exonware/xwsystem/io/serialization/parsers/hybrid_parser.py +7 -6
  185. exonware/xwsystem/io/serialization/parsers/msgspec_parser.py +10 -7
  186. exonware/xwsystem/io/serialization/parsers/orjson_direct_parser.py +7 -6
  187. exonware/xwsystem/io/serialization/parsers/orjson_parser.py +11 -8
  188. exonware/xwsystem/io/serialization/parsers/pysimdjson_parser.py +13 -9
  189. exonware/xwsystem/io/serialization/parsers/rapidjson_parser.py +10 -7
  190. exonware/xwsystem/io/serialization/parsers/registry.py +11 -10
  191. exonware/xwsystem/io/serialization/parsers/standard.py +7 -6
  192. exonware/xwsystem/io/serialization/parsers/ujson_parser.py +10 -7
  193. exonware/xwsystem/io/serialization/registry.py +4 -4
  194. exonware/xwsystem/io/serialization/serializer.py +168 -79
  195. exonware/xwsystem/io/serialization/universal_options.py +367 -0
  196. exonware/xwsystem/io/serialization/utils/__init__.py +1 -2
  197. exonware/xwsystem/io/serialization/utils/path_ops.py +5 -6
  198. exonware/xwsystem/io/source_reader.py +223 -0
  199. exonware/xwsystem/io/stream/__init__.py +1 -1
  200. exonware/xwsystem/io/stream/async_operations.py +61 -14
  201. exonware/xwsystem/io/stream/base.py +1 -2
  202. exonware/xwsystem/io/stream/codec_io.py +6 -7
  203. exonware/xwsystem/ipc/__init__.py +1 -0
  204. exonware/xwsystem/ipc/async_fabric.py +4 -4
  205. exonware/xwsystem/ipc/base.py +6 -5
  206. exonware/xwsystem/ipc/contracts.py +41 -66
  207. exonware/xwsystem/ipc/defs.py +2 -1
  208. exonware/xwsystem/ipc/errors.py +2 -1
  209. exonware/xwsystem/ipc/message_queue.py +5 -2
  210. exonware/xwsystem/ipc/pipes.py +70 -34
  211. exonware/xwsystem/ipc/process_manager.py +7 -5
  212. exonware/xwsystem/ipc/process_pool.py +6 -5
  213. exonware/xwsystem/ipc/shared_memory.py +64 -11
  214. exonware/xwsystem/monitoring/__init__.py +7 -0
  215. exonware/xwsystem/monitoring/base.py +11 -8
  216. exonware/xwsystem/monitoring/contracts.py +86 -144
  217. exonware/xwsystem/monitoring/defs.py +2 -1
  218. exonware/xwsystem/monitoring/error_recovery.py +16 -3
  219. exonware/xwsystem/monitoring/errors.py +2 -1
  220. exonware/xwsystem/monitoring/facade.py +183 -0
  221. exonware/xwsystem/monitoring/memory_monitor.py +1 -0
  222. exonware/xwsystem/monitoring/metrics.py +1 -0
  223. exonware/xwsystem/monitoring/performance_manager_generic.py +7 -7
  224. exonware/xwsystem/monitoring/performance_monitor.py +1 -0
  225. exonware/xwsystem/monitoring/performance_validator.py +1 -0
  226. exonware/xwsystem/monitoring/system_monitor.py +6 -5
  227. exonware/xwsystem/monitoring/tracing.py +18 -16
  228. exonware/xwsystem/monitoring/tracker.py +2 -1
  229. exonware/xwsystem/operations/__init__.py +5 -50
  230. exonware/xwsystem/operations/base.py +3 -44
  231. exonware/xwsystem/operations/contracts.py +25 -15
  232. exonware/xwsystem/operations/defs.py +1 -1
  233. exonware/xwsystem/operations/diff.py +5 -4
  234. exonware/xwsystem/operations/errors.py +1 -1
  235. exonware/xwsystem/operations/merge.py +6 -4
  236. exonware/xwsystem/operations/patch.py +5 -4
  237. exonware/xwsystem/patterns/__init__.py +1 -0
  238. exonware/xwsystem/patterns/base.py +2 -1
  239. exonware/xwsystem/patterns/context_manager.py +2 -1
  240. exonware/xwsystem/patterns/contracts.py +215 -256
  241. exonware/xwsystem/patterns/defs.py +2 -1
  242. exonware/xwsystem/patterns/dynamic_facade.py +1 -0
  243. exonware/xwsystem/patterns/errors.py +2 -4
  244. exonware/xwsystem/patterns/handler_factory.py +2 -3
  245. exonware/xwsystem/patterns/import_registry.py +1 -0
  246. exonware/xwsystem/patterns/object_pool.py +1 -0
  247. exonware/xwsystem/patterns/registry.py +4 -43
  248. exonware/xwsystem/plugins/__init__.py +2 -1
  249. exonware/xwsystem/plugins/base.py +6 -5
  250. exonware/xwsystem/plugins/contracts.py +94 -158
  251. exonware/xwsystem/plugins/defs.py +2 -1
  252. exonware/xwsystem/plugins/errors.py +2 -1
  253. exonware/xwsystem/py.typed +3 -0
  254. exonware/xwsystem/query/__init__.py +36 -0
  255. exonware/xwsystem/query/contracts.py +56 -0
  256. exonware/xwsystem/query/errors.py +22 -0
  257. exonware/xwsystem/query/registry.py +128 -0
  258. exonware/xwsystem/runtime/__init__.py +2 -1
  259. exonware/xwsystem/runtime/base.py +4 -3
  260. exonware/xwsystem/runtime/contracts.py +39 -60
  261. exonware/xwsystem/runtime/defs.py +2 -1
  262. exonware/xwsystem/runtime/env.py +11 -9
  263. exonware/xwsystem/runtime/errors.py +2 -1
  264. exonware/xwsystem/runtime/reflection.py +3 -2
  265. exonware/xwsystem/security/__init__.py +68 -11
  266. exonware/xwsystem/security/audit.py +167 -0
  267. exonware/xwsystem/security/base.py +121 -24
  268. exonware/xwsystem/security/contracts.py +91 -146
  269. exonware/xwsystem/security/crypto.py +17 -16
  270. exonware/xwsystem/security/defs.py +2 -1
  271. exonware/xwsystem/security/errors.py +2 -1
  272. exonware/xwsystem/security/facade.py +321 -0
  273. exonware/xwsystem/security/file_security.py +330 -0
  274. exonware/xwsystem/security/hazmat.py +11 -8
  275. exonware/xwsystem/security/monitor.py +372 -0
  276. exonware/xwsystem/security/path_validator.py +140 -18
  277. exonware/xwsystem/security/policy.py +357 -0
  278. exonware/xwsystem/security/resource_limits.py +1 -0
  279. exonware/xwsystem/security/validator.py +455 -0
  280. exonware/xwsystem/shared/__init__.py +14 -1
  281. exonware/xwsystem/shared/base.py +285 -2
  282. exonware/xwsystem/shared/contracts.py +415 -126
  283. exonware/xwsystem/shared/defs.py +2 -1
  284. exonware/xwsystem/shared/errors.py +2 -2
  285. exonware/xwsystem/shared/xwobject.py +316 -0
  286. exonware/xwsystem/structures/__init__.py +1 -0
  287. exonware/xwsystem/structures/base.py +3 -2
  288. exonware/xwsystem/structures/circular_detector.py +15 -14
  289. exonware/xwsystem/structures/contracts.py +53 -76
  290. exonware/xwsystem/structures/defs.py +2 -1
  291. exonware/xwsystem/structures/errors.py +2 -1
  292. exonware/xwsystem/structures/tree_walker.py +2 -1
  293. exonware/xwsystem/threading/__init__.py +21 -4
  294. exonware/xwsystem/threading/async_primitives.py +6 -5
  295. exonware/xwsystem/threading/base.py +3 -2
  296. exonware/xwsystem/threading/contracts.py +87 -143
  297. exonware/xwsystem/threading/defs.py +2 -1
  298. exonware/xwsystem/threading/errors.py +2 -1
  299. exonware/xwsystem/threading/facade.py +175 -0
  300. exonware/xwsystem/threading/locks.py +1 -0
  301. exonware/xwsystem/threading/safe_factory.py +1 -0
  302. exonware/xwsystem/utils/__init__.py +40 -0
  303. exonware/xwsystem/utils/base.py +22 -21
  304. exonware/xwsystem/utils/contracts.py +50 -73
  305. exonware/xwsystem/utils/dt/__init__.py +19 -3
  306. exonware/xwsystem/utils/dt/base.py +5 -4
  307. exonware/xwsystem/utils/dt/contracts.py +22 -29
  308. exonware/xwsystem/utils/dt/defs.py +2 -1
  309. exonware/xwsystem/utils/dt/errors.py +2 -5
  310. exonware/xwsystem/utils/dt/formatting.py +88 -2
  311. exonware/xwsystem/utils/dt/humanize.py +10 -9
  312. exonware/xwsystem/utils/dt/parsing.py +56 -5
  313. exonware/xwsystem/utils/dt/timezone_utils.py +2 -24
  314. exonware/xwsystem/utils/errors.py +2 -4
  315. exonware/xwsystem/utils/paths.py +1 -0
  316. exonware/xwsystem/utils/string.py +49 -0
  317. exonware/xwsystem/utils/test_runner.py +185 -0
  318. exonware/xwsystem/utils/utils_contracts.py +2 -1
  319. exonware/xwsystem/utils/web.py +110 -0
  320. exonware/xwsystem/validation/__init__.py +25 -1
  321. exonware/xwsystem/validation/base.py +6 -5
  322. exonware/xwsystem/validation/contracts.py +29 -41
  323. exonware/xwsystem/validation/data_validator.py +1 -0
  324. exonware/xwsystem/validation/declarative.py +11 -8
  325. exonware/xwsystem/validation/defs.py +2 -1
  326. exonware/xwsystem/validation/errors.py +2 -1
  327. exonware/xwsystem/validation/facade.py +198 -0
  328. exonware/xwsystem/validation/fluent_validator.py +22 -19
  329. exonware/xwsystem/validation/schema_discovery.py +210 -0
  330. exonware/xwsystem/validation/type_safety.py +2 -1
  331. exonware/xwsystem/version.py +2 -2
  332. {exonware_xwsystem-0.1.0.1.dist-info → exonware_xwsystem-0.1.0.4.dist-info}/METADATA +71 -4
  333. exonware_xwsystem-0.1.0.4.dist-info/RECORD +337 -0
  334. exonware/xwsystem/cli/__init__.py +0 -43
  335. exonware/xwsystem/cli/console.py +0 -113
  336. exonware/xwsystem/cli/defs.py +0 -134
  337. exonware/xwsystem/conf.py +0 -44
  338. exonware/xwsystem/security/auth.py +0 -484
  339. exonware_xwsystem-0.1.0.1.dist-info/RECORD +0 -284
  340. {exonware_xwsystem-0.1.0.1.dist-info → exonware_xwsystem-0.1.0.4.dist-info}/WHEEL +0 -0
  341. {exonware_xwsystem-0.1.0.1.dist-info → exonware_xwsystem-0.1.0.4.dist-info}/licenses/LICENSE +0 -0
@@ -1,16 +1,18 @@
1
+ #exonware/xwsystem/src/exonware/xwsystem/patterns/contracts.py
1
2
  #exonware/xwsystem/patterns/contracts.py
2
3
  """
3
4
  Company: eXonware.com
4
5
  Author: Eng. Muhammad AlShehri
5
6
  Email: connect@exonware.com
6
- Version: 0.1.0.1
7
+ Version: 0.1.0.4
7
8
  Generation Date: September 04, 2025
8
9
 
9
10
  Pattern contracts and interfaces for XWSystem design patterns.
10
11
  """
11
12
 
12
- from abc import ABC, abstractmethod
13
- from typing import Any, Optional, Callable, Union
13
+ from __future__ import annotations
14
+
15
+ from typing import Any, Optional, Callable, Protocol, runtime_checkable
14
16
  # Root cause: Migrating to Python 3.12 built-in generic syntax for consistency
15
17
  # Priority #3: Maintainability - Modern type annotations improve code clarity
16
18
 
@@ -49,658 +51,615 @@ from .defs import (
49
51
  # CORE INTERFACES
50
52
  # ============================================================================
51
53
 
52
- class IHandler[T](ABC):
54
+ @runtime_checkable
55
+ class IHandler[T](Protocol):
53
56
  """Interface for handlers in the chain of responsibility pattern."""
54
57
 
55
- @abstractmethod
56
58
  def handle(self, request: T) -> T:
57
59
  """Handle the request."""
58
- pass
60
+ ...
59
61
 
60
- @abstractmethod
61
62
  def can_handle(self, request: T) -> bool:
62
63
  """Check if this handler can handle the request."""
63
- pass
64
+ ...
64
65
 
65
- @abstractmethod
66
- def set_next(self, handler: 'IHandler[T]') -> 'IHandler[T]':
66
+ def set_next(self, handler: IHandler[T]) -> IHandler[T]:
67
67
  """Set the next handler in the chain."""
68
- pass
68
+ ...
69
69
 
70
70
 
71
- class IHandlerFactory[T](ABC):
71
+ @runtime_checkable
72
+ class IHandlerFactory[T](Protocol):
72
73
  """Interface for handler factories."""
73
74
 
74
- @abstractmethod
75
75
  def create_handler(self, handler_type: str, **kwargs) -> T:
76
76
  """Create a handler of the specified type."""
77
- pass
77
+ ...
78
78
 
79
- @abstractmethod
80
79
  def register_handler(self, handler_type: str, handler_class: type[T]) -> None:
81
80
  """Register a handler class."""
82
- pass
81
+ ...
83
82
 
84
- @abstractmethod
85
83
  def unregister_handler(self, handler_type: str) -> None:
86
84
  """Unregister a handler class."""
87
- pass
85
+ ...
88
86
 
89
- @abstractmethod
90
87
  def list_handlers(self) -> list[str]:
91
88
  """List all registered handler types."""
92
- pass
89
+ ...
93
90
 
94
- @abstractmethod
95
91
  def has_handler(self, handler_type: str) -> bool:
96
92
  """Check if a handler type is registered."""
97
- pass
93
+ ...
98
94
 
99
95
 
100
- class IContextManager(ABC):
96
+ @runtime_checkable
97
+ class IContextManager(Protocol):
101
98
  """Interface for context managers."""
102
99
 
103
- @abstractmethod
104
- def __enter__(self) -> 'IContextManager':
100
+ def __enter__(self) -> IContextManager:
105
101
  """Enter the context."""
106
- pass
102
+ ...
107
103
 
108
- @abstractmethod
109
104
  def __exit__(self, exc_type: Optional[type[BaseException]],
110
105
  exc_val: Optional[BaseException],
111
106
  exc_tb: Optional[Any]) -> bool:
112
107
  """Exit the context."""
113
- pass
108
+ ...
114
109
 
115
- @abstractmethod
116
110
  def is_active(self) -> bool:
117
111
  """Check if context is active."""
118
- pass
112
+ ...
119
113
 
120
- @abstractmethod
121
114
  def get_context_data(self) -> dict[str, Any]:
122
115
  """Get context data."""
123
- pass
116
+ ...
124
117
 
125
118
 
126
- class IObjectPool[T](ABC):
119
+ @runtime_checkable
120
+ class IObjectPool[T](Protocol):
127
121
  """Interface for object pools."""
128
122
 
129
- @abstractmethod
130
123
  def get(self, obj_type: type[T], *args, **kwargs) -> T:
131
124
  """Get an object from the pool."""
132
- pass
125
+ ...
133
126
 
134
- @abstractmethod
135
127
  def release(self, obj: T) -> None:
136
128
  """Release an object back to the pool."""
137
- pass
129
+ ...
138
130
 
139
- @abstractmethod
140
131
  def clear(self, obj_type: Optional[type[T]] = None) -> None:
141
132
  """Clear objects from the pool."""
142
- pass
133
+ ...
143
134
 
144
- @abstractmethod
145
135
  def get_stats(self) -> dict[str, Any]:
146
136
  """Get pool statistics."""
147
- pass
137
+ ...
148
138
 
149
- @abstractmethod
150
139
  def is_empty(self, obj_type: type[T]) -> bool:
151
140
  """Check if pool is empty for a type."""
152
- pass
141
+ ...
153
142
 
154
143
 
155
- class IRegistry[K, V](ABC):
144
+ @runtime_checkable
145
+ class IRegistry[K, V](Protocol):
156
146
  """Interface for registries."""
157
147
 
158
- @abstractmethod
159
148
  def register(self, key: K, value: V) -> None:
160
149
  """Register a value with a key."""
161
- pass
150
+ ...
162
151
 
163
- @abstractmethod
164
152
  def unregister(self, key: K) -> V:
165
153
  """Unregister a value by key."""
166
- pass
154
+ ...
167
155
 
168
- @abstractmethod
169
156
  def get(self, key: K) -> Optional[V]:
170
157
  """Get a value by key."""
171
- pass
158
+ ...
172
159
 
173
- @abstractmethod
174
160
  def has(self, key: K) -> bool:
175
161
  """Check if key exists."""
176
- pass
162
+ ...
177
163
 
178
- @abstractmethod
179
164
  def list_keys(self) -> list[K]:
180
165
  """List all keys."""
181
- pass
166
+ ...
182
167
 
183
- @abstractmethod
184
168
  def list_values(self) -> list[V]:
185
169
  """List all values."""
186
- pass
170
+ ...
187
171
 
188
- @abstractmethod
189
172
  def clear(self) -> None:
190
173
  """Clear all entries."""
191
- pass
174
+ ...
175
+
176
+
177
+ @runtime_checkable
178
+ class IGenericRegistry[T](Protocol):
179
+ """
180
+ Interface for generic registry implementations with metadata support.
181
+
182
+ Root cause: Adding generic type parameter for better type safety.
183
+ Priority #3: Maintainability - Generic types improve code clarity and type checking.
184
+ """
185
+
186
+ def register(self, name: str, item: T, metadata: Optional[dict[str, Any]] = None) -> bool:
187
+ """Register an item with optional metadata."""
188
+ ...
189
+
190
+ def unregister(self, name: str) -> bool:
191
+ """Unregister an item."""
192
+ ...
193
+
194
+ def get(self, name: str) -> Optional[T]:
195
+ """Get an item by name."""
196
+ ...
197
+
198
+ def list_names(self) -> list[str]:
199
+ """List all registered names."""
200
+ ...
201
+
202
+ def exists(self, name: str) -> bool:
203
+ """Check if an item exists."""
204
+ ...
205
+
206
+ def clear(self) -> bool:
207
+ """Clear all registrations."""
208
+ ...
192
209
 
193
210
 
194
- class IStrategy(ABC):
211
+ @runtime_checkable
212
+ class IStrategy(Protocol):
195
213
  """Interface for strategies."""
196
214
 
197
- @abstractmethod
198
215
  def execute(self, context: Any) -> Any:
199
216
  """Execute the strategy."""
200
- pass
217
+ ...
201
218
 
202
- @abstractmethod
203
219
  def can_handle(self, context: Any) -> bool:
204
220
  """Check if strategy can handle context."""
205
- pass
221
+ ...
206
222
 
207
- @abstractmethod
208
223
  def get_name(self) -> str:
209
224
  """Get strategy name."""
210
- pass
225
+ ...
211
226
 
212
227
 
213
- class IObserver(ABC):
228
+ @runtime_checkable
229
+ class IObserver(Protocol):
214
230
  """Interface for observers."""
215
231
 
216
- @abstractmethod
217
- def update(self, subject: 'ISubject', event: Any) -> None:
232
+ def update(self, subject: ISubject, event: Any) -> None:
218
233
  """Update the observer."""
219
- pass
234
+ ...
220
235
 
221
- @abstractmethod
222
236
  def get_id(self) -> str:
223
237
  """Get observer ID."""
224
- pass
238
+ ...
225
239
 
226
240
 
227
- class ISubject(ABC):
241
+ @runtime_checkable
242
+ class ISubject(Protocol):
228
243
  """Interface for subjects."""
229
244
 
230
- @abstractmethod
231
245
  def attach(self, observer: IObserver) -> None:
232
246
  """Attach an observer."""
233
- pass
247
+ ...
234
248
 
235
- @abstractmethod
236
249
  def detach(self, observer: IObserver) -> None:
237
250
  """Detach an observer."""
238
- pass
251
+ ...
239
252
 
240
- @abstractmethod
241
253
  def notify(self, event: Any) -> None:
242
254
  """Notify all observers."""
243
- pass
255
+ ...
244
256
 
245
257
 
246
- class ICommand(ABC):
258
+ @runtime_checkable
259
+ class ICommand(Protocol):
247
260
  """Interface for commands."""
248
261
 
249
- @abstractmethod
250
262
  def execute(self) -> Any:
251
263
  """Execute the command."""
252
- pass
264
+ ...
253
265
 
254
- @abstractmethod
255
266
  def undo(self) -> Any:
256
267
  """Undo the command."""
257
- pass
268
+ ...
258
269
 
259
- @abstractmethod
260
270
  def can_undo(self) -> bool:
261
271
  """Check if command can be undone."""
262
- pass
272
+ ...
263
273
 
264
- @abstractmethod
265
274
  def get_description(self) -> str:
266
275
  """Get command description."""
267
- pass
276
+ ...
268
277
 
269
278
 
270
- class IState(ABC):
279
+ @runtime_checkable
280
+ class IState(Protocol):
271
281
  """Interface for states."""
272
282
 
273
- @abstractmethod
274
283
  def enter(self, context: Any) -> None:
275
284
  """Enter the state."""
276
- pass
285
+ ...
277
286
 
278
- @abstractmethod
279
287
  def exit(self, context: Any) -> None:
280
288
  """Exit the state."""
281
- pass
289
+ ...
282
290
 
283
- @abstractmethod
284
291
  def handle(self, context: Any, event: Any) -> None:
285
292
  """Handle an event in this state."""
286
- pass
293
+ ...
287
294
 
288
- @abstractmethod
289
295
  def get_name(self) -> str:
290
296
  """Get state name."""
291
- pass
297
+ ...
292
298
 
293
299
 
294
- class IBuilder[T](ABC):
300
+ @runtime_checkable
301
+ class IBuilder[T](Protocol):
295
302
  """Interface for builders."""
296
303
 
297
- @abstractmethod
298
304
  def build(self) -> T:
299
305
  """Build the object."""
300
- pass
306
+ ...
301
307
 
302
- @abstractmethod
303
- def reset(self) -> 'IBuilder[T]':
308
+ def reset(self) -> IBuilder[T]:
304
309
  """Reset the builder."""
305
- pass
310
+ ...
306
311
 
307
- @abstractmethod
308
312
  def is_valid(self) -> bool:
309
313
  """Check if builder is in valid state."""
310
- pass
314
+ ...
311
315
 
312
316
 
313
- class IPrototype[T](ABC):
317
+ @runtime_checkable
318
+ class IPrototype[T](Protocol):
314
319
  """Interface for prototypes."""
315
320
 
316
- @abstractmethod
317
321
  def clone(self) -> T:
318
322
  """Clone the object."""
319
- pass
323
+ ...
320
324
 
321
- @abstractmethod
322
325
  def deep_clone(self) -> T:
323
326
  """Create a deep clone."""
324
- pass
327
+ ...
325
328
 
326
- @abstractmethod
327
329
  def shallow_clone(self) -> T:
328
330
  """Create a shallow clone."""
329
- pass
331
+ ...
330
332
 
331
333
 
332
- class IAdapter(ABC):
334
+ @runtime_checkable
335
+ class IAdapter(Protocol):
333
336
  """Interface for adapters."""
334
337
 
335
- @abstractmethod
336
338
  def adapt(self, source: Any) -> Any:
337
339
  """Adapt source to target."""
338
- pass
340
+ ...
339
341
 
340
- @abstractmethod
341
342
  def can_adapt(self, source: Any) -> bool:
342
343
  """Check if source can be adapted."""
343
- pass
344
+ ...
344
345
 
345
- @abstractmethod
346
346
  def get_source_type(self) -> type:
347
347
  """Get source type."""
348
- pass
348
+ ...
349
349
 
350
- @abstractmethod
351
350
  def get_target_type(self) -> type:
352
351
  """Get target type."""
353
- pass
352
+ ...
354
353
 
355
354
 
356
- class IDecorator[T](ABC):
355
+ @runtime_checkable
356
+ class IDecorator[T](Protocol):
357
357
  """Interface for decorators."""
358
358
 
359
- @abstractmethod
360
359
  def decorate(self, target: T) -> T:
361
360
  """Decorate the target."""
362
- pass
361
+ ...
363
362
 
364
- @abstractmethod
365
363
  def undecorate(self, target: T) -> T:
366
364
  """Remove decoration from target."""
367
- pass
365
+ ...
368
366
 
369
- @abstractmethod
370
367
  def is_decorated(self, target: T) -> bool:
371
368
  """Check if target is decorated."""
372
- pass
369
+ ...
373
370
 
374
371
 
375
- class IProxy[T](ABC):
372
+ @runtime_checkable
373
+ class IProxy[T](Protocol):
376
374
  """Interface for proxies."""
377
375
 
378
- @abstractmethod
379
376
  def get_real_object(self) -> T:
380
377
  """Get the real object."""
381
- pass
378
+ ...
382
379
 
383
- @abstractmethod
384
380
  def is_accessible(self) -> bool:
385
381
  """Check if real object is accessible."""
386
- pass
382
+ ...
387
383
 
388
- @abstractmethod
389
384
  def get_proxy_type(self) -> str:
390
385
  """Get proxy type."""
391
- pass
386
+ ...
392
387
 
393
388
 
394
- class IFacade(ABC):
389
+ @runtime_checkable
390
+ class IFacade(Protocol):
395
391
  """Interface for facades."""
396
392
 
397
- @abstractmethod
398
393
  def execute(self, operation: str, *args, **kwargs) -> Any:
399
394
  """Execute an operation through the facade."""
400
- pass
395
+ ...
401
396
 
402
- @abstractmethod
403
397
  def get_available_operations(self) -> list[str]:
404
398
  """Get list of available operations."""
405
- pass
399
+ ...
406
400
 
407
- @abstractmethod
408
401
  def is_operation_supported(self, operation: str) -> bool:
409
402
  """Check if operation is supported."""
410
- pass
403
+ ...
411
404
 
412
405
 
413
- class IDynamicFacade(ABC):
406
+ @runtime_checkable
407
+ class IDynamicFacade(Protocol):
414
408
  """Interface for dynamic facades."""
415
409
 
416
- @abstractmethod
417
410
  def get_available_formats(self) -> list[str]:
418
411
  """Get list of available formats."""
419
- pass
412
+ ...
420
413
 
421
- @abstractmethod
422
414
  def has_format(self, format_name: str) -> bool:
423
415
  """Check if format is available."""
424
- pass
416
+ ...
425
417
 
426
- @abstractmethod
427
418
  def load(self, source: Any, format_name: str, **kwargs) -> Any:
428
419
  """Load data using specified format."""
429
- pass
420
+ ...
430
421
 
431
- @abstractmethod
432
422
  def save(self, data: Any, target: Any, format_name: str, **kwargs) -> None:
433
423
  """Save data using specified format."""
434
- pass
424
+ ...
435
425
 
436
426
 
437
- class IChainHandler(ABC):
427
+ @runtime_checkable
428
+ class IChainHandler(Protocol):
438
429
  """Interface for chain handlers."""
439
430
 
440
- @abstractmethod
441
431
  def handle(self, request: Any) -> Any:
442
432
  """Handle the request."""
443
- pass
433
+ ...
444
434
 
445
- @abstractmethod
446
- def set_next(self, handler: 'IChainHandler') -> 'IChainHandler':
435
+ def set_next(self, handler: IChainHandler) -> IChainHandler:
447
436
  """Set the next handler."""
448
- pass
437
+ ...
449
438
 
450
- @abstractmethod
451
439
  def can_handle(self, request: Any) -> bool:
452
440
  """Check if can handle request."""
453
- pass
441
+ ...
454
442
 
455
443
 
456
- class IMediator(ABC):
444
+ @runtime_checkable
445
+ class IMediator(Protocol):
457
446
  """Interface for mediators."""
458
447
 
459
- @abstractmethod
460
448
  def register_colleague(self, colleague_id: str, colleague: Any) -> None:
461
449
  """Register a colleague."""
462
- pass
450
+ ...
463
451
 
464
- @abstractmethod
465
452
  def unregister_colleague(self, colleague_id: str) -> None:
466
453
  """Unregister a colleague."""
467
- pass
454
+ ...
468
455
 
469
- @abstractmethod
470
456
  def send_message(self, sender_id: str, receiver_id: str, message: Any) -> None:
471
457
  """Send a message between colleagues."""
472
- pass
458
+ ...
473
459
 
474
- @abstractmethod
475
460
  def broadcast_message(self, sender_id: str, message: Any) -> None:
476
461
  """Broadcast a message to all colleagues."""
477
- pass
462
+ ...
478
463
 
479
464
 
480
- class IMemento(ABC):
465
+ @runtime_checkable
466
+ class IMemento(Protocol):
481
467
  """Interface for mementos."""
482
468
 
483
- @abstractmethod
484
469
  def get_state(self) -> Any:
485
470
  """Get the saved state."""
486
- pass
471
+ ...
487
472
 
488
- @abstractmethod
489
473
  def get_timestamp(self) -> float:
490
474
  """Get creation timestamp."""
491
- pass
475
+ ...
492
476
 
493
- @abstractmethod
494
477
  def get_description(self) -> str:
495
478
  """Get memento description."""
496
- pass
479
+ ...
497
480
 
498
481
 
499
- class IOriginator(ABC):
482
+ @runtime_checkable
483
+ class IOriginator(Protocol):
500
484
  """Interface for originators."""
501
485
 
502
- @abstractmethod
503
486
  def create_memento(self) -> IMemento:
504
487
  """Create a memento."""
505
- pass
488
+ ...
506
489
 
507
- @abstractmethod
508
490
  def restore_from_memento(self, memento: IMemento) -> None:
509
491
  """Restore from memento."""
510
- pass
492
+ ...
511
493
 
512
494
 
513
- class IVisitor(ABC):
495
+ @runtime_checkable
496
+ class IVisitor(Protocol):
514
497
  """Interface for visitors."""
515
498
 
516
- @abstractmethod
517
499
  def visit(self, element: Any) -> Any:
518
500
  """Visit an element."""
519
- pass
501
+ ...
520
502
 
521
- @abstractmethod
522
503
  def can_visit(self, element: Any) -> bool:
523
504
  """Check if can visit element."""
524
- pass
505
+ ...
525
506
 
526
507
 
527
- class IElement(ABC):
508
+ @runtime_checkable
509
+ class IElement(Protocol):
528
510
  """Interface for elements that accept visitors."""
529
511
 
530
- @abstractmethod
531
512
  def accept(self, visitor: IVisitor) -> Any:
532
513
  """Accept a visitor."""
533
- pass
514
+ ...
534
515
 
535
516
 
536
- class IIterator[T](ABC):
517
+ @runtime_checkable
518
+ class IIterator[T](Protocol):
537
519
  """Interface for iterators."""
538
520
 
539
- @abstractmethod
540
521
  def __next__(self) -> T:
541
522
  """Get next item."""
542
- pass
523
+ ...
543
524
 
544
- @abstractmethod
545
- def __iter__(self) -> 'IIterator[T]':
525
+ def __iter__(self) -> IIterator[T]:
546
526
  """Get iterator."""
547
- pass
527
+ ...
548
528
 
549
- @abstractmethod
550
529
  def has_next(self) -> bool:
551
530
  """Check if has next item."""
552
- pass
531
+ ...
553
532
 
554
- @abstractmethod
555
533
  def reset(self) -> None:
556
534
  """Reset iterator."""
557
- pass
535
+ ...
558
536
 
559
537
 
560
- class IConcurrencyControl(ABC):
538
+ @runtime_checkable
539
+ class IConcurrencyControl(Protocol):
561
540
  """Interface for concurrency control."""
562
541
 
563
- @abstractmethod
564
542
  def acquire(self) -> None:
565
543
  """Acquire the lock."""
566
- pass
544
+ ...
567
545
 
568
- @abstractmethod
569
546
  def release(self) -> None:
570
547
  """Release the lock."""
571
- pass
548
+ ...
572
549
 
573
- @abstractmethod
574
550
  def is_locked(self) -> bool:
575
551
  """Check if locked."""
576
- pass
552
+ ...
577
553
 
578
- @abstractmethod
579
554
  def try_acquire(self, timeout: Optional[float] = None) -> bool:
580
555
  """Try to acquire with timeout."""
581
- pass
556
+ ...
582
557
 
583
558
 
584
- class IArchitecturalPattern(ABC):
559
+ @runtime_checkable
560
+ class IArchitecturalPattern(Protocol):
585
561
  """Interface for architectural patterns."""
586
562
 
587
- @abstractmethod
588
563
  def initialize(self) -> None:
589
564
  """Initialize the pattern."""
590
- pass
565
+ ...
591
566
 
592
- @abstractmethod
593
567
  def shutdown(self) -> None:
594
568
  """Shutdown the pattern."""
595
- pass
569
+ ...
596
570
 
597
- @abstractmethod
598
571
  def is_initialized(self) -> bool:
599
572
  """Check if initialized."""
600
- pass
573
+ ...
601
574
 
602
- @abstractmethod
603
575
  def get_components(self) -> list[str]:
604
576
  """Get list of components."""
605
- pass
577
+ ...
606
578
 
607
579
 
608
- class ISpecification(ABC):
580
+ @runtime_checkable
581
+ class ISpecification(Protocol):
609
582
  """Interface for specifications."""
610
583
 
611
- @abstractmethod
612
584
  def is_satisfied_by(self, candidate: Any) -> bool:
613
585
  """Check if candidate satisfies specification."""
614
- pass
586
+ ...
615
587
 
616
- @abstractmethod
617
- def and_specification(self, other: 'ISpecification') -> 'ISpecification':
588
+ def and_specification(self, other: ISpecification) -> ISpecification:
618
589
  """Create AND specification."""
619
- pass
590
+ ...
620
591
 
621
- @abstractmethod
622
- def or_specification(self, other: 'ISpecification') -> 'ISpecification':
592
+ def or_specification(self, other: ISpecification) -> ISpecification:
623
593
  """Create OR specification."""
624
- pass
594
+ ...
625
595
 
626
- @abstractmethod
627
- def not_specification(self) -> 'ISpecification':
596
+ def not_specification(self) -> ISpecification:
628
597
  """Create NOT specification."""
629
- pass
598
+ ...
630
599
 
631
600
 
632
- class IValueObject(ABC):
601
+ @runtime_checkable
602
+ class IValueObject(Protocol):
633
603
  """Interface for value objects."""
634
604
 
635
- @abstractmethod
636
605
  def equals(self, other: Any) -> bool:
637
606
  """Check if equal to other."""
638
- pass
607
+ ...
639
608
 
640
- @abstractmethod
641
609
  def get_hash(self) -> int:
642
610
  """Get hash code."""
643
- pass
611
+ ...
644
612
 
645
- @abstractmethod
646
613
  def to_string(self) -> str:
647
614
  """Convert to string."""
648
- pass
615
+ ...
649
616
 
650
617
 
651
- class IAggregate(ABC):
618
+ @runtime_checkable
619
+ class IAggregate(Protocol):
652
620
  """Interface for aggregates in domain-driven design."""
653
621
 
654
- @abstractmethod
655
622
  def get_id(self) -> str:
656
623
  """Get the aggregate ID."""
657
- pass
624
+ ...
658
625
 
659
- @abstractmethod
660
626
  def get_version(self) -> int:
661
627
  """Get the aggregate version."""
662
- pass
628
+ ...
663
629
 
664
- @abstractmethod
665
630
  def get_uncommitted_events(self) -> list[Any]:
666
631
  """Get uncommitted events."""
667
- pass
632
+ ...
668
633
 
669
- @abstractmethod
670
634
  def mark_events_as_committed(self) -> None:
671
635
  """Mark events as committed."""
672
- pass
636
+ ...
673
637
 
674
638
 
675
- class IPattern(ABC):
639
+ @runtime_checkable
640
+ class IPattern(Protocol):
676
641
  """Interface for design patterns."""
677
642
 
678
- @abstractmethod
679
643
  def get_pattern_type(self) -> PatternType:
680
644
  """Get pattern type."""
681
- pass
645
+ ...
682
646
 
683
- @abstractmethod
684
647
  def get_name(self) -> str:
685
648
  """Get pattern name."""
686
- pass
649
+ ...
687
650
 
688
- @abstractmethod
689
651
  def get_description(self) -> str:
690
652
  """Get pattern description."""
691
- pass
653
+ ...
692
654
 
693
- @abstractmethod
694
655
  def is_applicable(self, context: Any) -> bool:
695
656
  """Check if pattern is applicable to context."""
696
- pass
657
+ ...
697
658
 
698
- @abstractmethod
699
659
  def apply(self, context: Any) -> Any:
700
660
  """Apply the pattern to context."""
701
- pass
661
+ ...
702
662
 
703
- @abstractmethod
704
663
  def validate(self, data: Any) -> bool:
705
664
  """Validate data for pattern application."""
706
- pass
665
+ ...