Rock U - Rock Fundamentals - Properties and Attributes
Transcribed Video Content
Two more quick vocabulary words that we need to define before we move on. Properties and attributes. Now, already defined the word entity and that's a grouping of content people, groups, financial transactions and they live in the box. So whenever we hear the word entity, we're just really talking about a specific type of data in Rock. Now within entities, entities can have properties and attributes.
Let's talk about properties first. So if you bought that box for cleaning out your junk drawer, you hopefully have dividers within there so you can subdivide that that those items. It's the same thing with Rock. So think of it almost an excel spreadsheets. Your rows will be different people in the database and your columns will be different things about that person.
And those are the properties. So when you think of the word column, think properties. If we were to kinda fill in some sample data here, you would see Ted Decker might be the first row, his wife Cindy is below that, and their son Noah is the third row. And the properties would be first name, last name, age, email address. So those are the properties.
When you think properties those are really the attributes about a person or the characteristics about a person that we store right on the entity. Now what happens commonly is someone comes up with a property that we just don't have room or we didn't think ahead and add towards the database. And no matter how hard we worked or how hard we tried, we would never get all of the attributes that someone would want to know about a person. So in this case, let's say that someone comes along and says, well, I need to store the t shirt size for a person. Well, there's really not a place for that on in the inside the box, , on the entity as a property.
So what do we do? We create that as an attribute. So think about attributes as being a different type of entity that relate back to the original one. One. So in this case, if we look at this example, this is how we would tie in things t shirt size.
The ID of the person is tied to the ID in the attribute table and there we have the value of their t shirt size. So attributes are things that kind of extend the properties that are on an an entity. Now when you define these attributes, you have to say what kind of data are you gonna store in that in that little box, in that cell. And those are field types. So think of field types, this is actually kind of the fun part of Rock because you get to pick, , how you're gonna display that, how you're gonna edit that value.
And so Rock has a whole bunch of different field types. So here we see field types for a person picker, an email, a t shirt size selector, a numeric range, a date and there's really a whole bunch of different field types. This screen here doesn't really show them all. If you wanted to see all the field types, know, that you'd see it's a fairly long list. But as you're defining your attributes, this is where you get to have fun and determine what type of field type do you want and a lot of these field types have a lot of different configuration that you can do some really powerful things with.
So hopefully that helps you understand better what a property and an attribute are.