The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Mixing in Validatable

Mixing in Validatable

12:07
Now that the validation component has progressed, we can start mixing it in for usage. This video is a part of a series, you'll want to watch the [earlier lessons](https://egghead.io/series/angularjs-data-modeling) before this one.
Watch this lesson now
Avatar
egghead.io

Now that the validation component has progressed, we can start mixing it in for usage.

This video is a part of a series, you'll want to watch the earlier lessons before this one.

Avatar
andrew

One problem that I'm having with this series is keeping what you're saying... straight. What i mean is, its hard to visualize the code/execution flow of whats going on... when I'm writing code one thing I do to help other people keep track of how a class works is by creating a code flow diagram... which looks something like this:

|                          - spacer that imply's connection. used for readability.

|=>                     - is made of

--->                   -  calls

=result=              - end result of flow

||                         - or

&&                     - and 

UpperCase      - Class

camelCase       - method / closure

__privateCase  -private function



Ex:  (This is not going to be very accurate but should get point across)


BaseClass
|
|=> Validatable
|=> Errorable
|=> Cachable


Validatable
|
|=>Validator
|--->  checkOptions   --->  __selectValidationFunction ---> ValidationFn
|
|
|=>ValidationFn
|--->  __checkOptionValidity  --->   =throwError=   ||   =returnValidity=

the purpose is just to show a 1000ft view of how the code flows; just helps someone see the structure of stuff. Kinda like a road map.

Thoughts?

(ps I'd have gone

Avatar
Per

Totally agree with Andrew here. It's very hard to follow the flow through all different kinds of factories. You should add some kind of diagram of the structure and data flow. Also, I feel the validation videos are a bit off topic. I wanted to see how the data model would handle requests etc. which is kind of its core function, but the series suddenly turned into a validation guide. I agree validation is an important feature to have, but I'd say it's something you add to the data model once it's completed. At least that would make these series easier to follow.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?