Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seandenigris/validation-revisited
An implementation of the extreme validation section of "A Mentoring Course on Smalltalk"
https://github.com/seandenigris/validation-revisited
pharo smalltalk validation
Last synced: 24 days ago
JSON representation
An implementation of the extreme validation section of "A Mentoring Course on Smalltalk"
- Host: GitHub
- URL: https://github.com/seandenigris/validation-revisited
- Owner: seandenigris
- License: mit
- Created: 2018-03-11T16:40:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-11T18:45:53.000Z (almost 7 years ago)
- Last Synced: 2024-10-30T06:27:30.790Z (2 months ago)
- Topics: pharo, smalltalk, validation
- Language: Smalltalk
- Size: 45.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation
```smalltalk
Metacello new
baseline: 'ValidationRevisited';
repository: 'github://seandenigris/Validation-Revisited:master/src';
load.
```## Motivation
This is a port of the code from the extreme validation section of "A Mentoring Course on Smalltalk", Andres Valloud's OOP bible [see my blog post](http://seandenigris.com/blog/?p=573).
## Usage
Here is [a short screencast](https://vimeo.com/67244280) of a little UI monitoring the health of a domain object in real-time.
`#validate` is the main entry point for the framework. You can call this on any domain object and the validation rules will be run. Under the hood are specialized SUnit classes. The `Validator` subclass, a specialized `TestCase`, holds the rules for the object.
The really cool thing is that the failures are real objects which hold the domain object, the property that failed (called an 'aspect'), and the description. So you could do a lot more than show the description. The idea of ongoingly monitoring the health of models is fascinating. It would be great for SimplePersistence and other serialization libraries to check the model after materializing to make sure everything is as expected. The potential for really non-intrusive UI validation is obvious, and exciting too!
*N.B.* Andres mentioned that he did an implementation in VW called Assessments that went far beyond the book. One more reason to get cross-platform filetree/cypress working ;)