faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
_whitelogger has joined #amber
<FromGitter> <katafrakt> @Blacksmoke16 If I may share my opinion, my current take (not in Amber, but in general, I code Ruby mostly) is that validation is for data that is entering the system - and it should be ORM-independent. And checking data integrity is fine and very useful - but it should only throw exceptions, not generate fancy error messages to display to end user.
<FromGitter> <Blacksmoke16> right exactly
<FromGitter> <Blacksmoke16> what are your thoughts on https://github.com/amberframework/granite/issues/358 ?
<FromGitter> <Blacksmoke16> @katafrakt ^
<FromGitter> <wpv1999> wpv1999 09:14 ⏎ I want to know how to set up the framework to do this DNA sequence in comparison with today's datasets can someone join that to me to give me a suggestion or tell me how to pickle say I'm not I am beginner at it http: / /dmb.iasi.cnr.it/camur.php please Let Me Know If someone knows How to set up anything just to load dataset.
<FromGitter> <Blacksmoke16> i mean thats not really related to this framework at all tho?
<FromGitter> <Blacksmoke16> more so like "how to load data into a database"?
<FromGitter> <Blacksmoke16> if anything you could user amber to make a webapp to interact with the data
<FromGitter> <drujensen> @katafrakt that sounds like a good idea; use exception handling for validations. That would allow the validations to exist anywhere and all be handled in the controller or pipeline.
<FromGitter> <drujensen> You would still want to collect all the validation errors at once
<FromGitter> <Blacksmoke16> thats how assert works ^ https://blacksmoke16.github.io/assert/Assert/Exceptions/ValidationError.html
<FromGitter> <Blacksmoke16> probably should add a getter for the failed assertions on the exception tho
<FromGitter> <Blacksmoke16> does provide some methods for easily rendering what failed, but the getter would make it so you could do more custom stuff
<FromGitter> <Blacksmoke16> depends on how you want to implement it
<FromGitter> <katafrakt> At first using annotation seems weird. I'd need to wrap my head around that. But to clarify, I think those low-lever exception-based validations should fail very rarely and be a sign of something not going well in other parts of the system. Meanwhile the controller/view layer would use other validations, something similar to dry-validations in Ruby (I don't know if such thing exists in Crystal already).
<FromGitter> <Blacksmoke16> why couldnt they share the same validations?
<FromGitter> <Blacksmoke16> to me it would make more sense to have the annotation based assertions be at the front of your application, then if it gets past that you know the obj is valid
<FromGitter> <Blacksmoke16> https://dev.to/blacksmoke16/object-validation-with-assert-25p6 i wrote a blog post on `assert`, are some examples related to how it would work in a kemal api for example
<FromGitter> <eliasjpr> I incline to have a separate shard for validations, validations can live in any layer. What would be nice for Granite is to be able to understand Database check constraints exceptions this way the data integrity in the database can be enforced and the application will be able@to@understand it. This way there could be app related validation and integrity and data persistence integrity imo they could be related but are
<FromGitter> ... completely different
<FromGitter> <eliasjpr> I am not a fan of annotations but I accept that is an approach
<FromGitter> <Blacksmoke16> Are two types of exceptions that could happen. Business logic validations and database integrity
<FromGitter> <Blacksmoke16> The database would inherently prevent the latter
<FromGitter> <Blacksmoke16> If anything I'd be a fan of refactoring granite error handling to make those exceptions easier
<FromGitter> <Blacksmoke16> Diff exception classes and get rid of the errors array, just leads to hard to debug code since that's not usual behavior