Skip to content
nairdo edited this page Sep 16, 2013 · 3 revisions

Warning

TODO: This document needs to be updated. Dto classes are no longer used in Rock. Also, classes have been moved into different folders again -- namely a Model folder for the Rock project and Controllers folder for the Rock.Rest project.

This project contains the entity framework (EF) models, repository, services, migrations, etc. -- or nearly everything that is not a test, part of the REST api, or the website.

Models - Each class is grouped under a logically named folder and represents an EF entity whose data is persisted using a corresponding repository class (described next).

The Model class extends the Entity base class and implements security and attributes. Most core and custom entities will inherit from the Model class, however some classes will inherit directly from Entity (such as AttributeQualifier, Audit, EntityType, etc.).

Service Classes - These classes (such as LocationService.cs) inherit from the Service class and represent the proper way to interact (retrieve/save) with the corresponding entities which are persisted in the repository. Auto-generated code files may also be found under a CodeGenerated sub-folder.

var locationService = new LocationService();
var locationService = new LocationService();
var location = locationService.GetByStreet1AndStreet2AndCityAndStateAndZip( "555 Main", "", "Chicago", "IL", "60001" );
location.Street1 = "555 Main St";
locationService.Save();

Corresponding partial classes (such as LocationService.partial.cs) would hold the non-auto generated "business logic" and convenience methods for the entity.

Dto Classes - These Data Transfer Objects (such as LocationDto.cs) represent the light-weight, disconnected (from the repository) objects that are suitable for transmission across the wire. They implement the IDto interface. Auto-generated code files may also be found under a CodeGenerated sub-folder.

##Cms Entities

The Cms entities are the parts that make up the Content Management System of Rock. These are primarily Sites, Pages, and Blocks. Other notable entities are Auth and User.

Sites – These typically correspond to a unique website or domain and are comprised of a collection of pages.

Page – A page belongs to a site and also has a layout which defines its structure or zones (header, footer, main, etc.). A page can have a parent page and can also have one or more child pages.

Blocks – These "building blocks" represent reusable pieces of functionality (ASP.NET UserControls). Blocks can be added to a page by adding them a zone on a page or by adding them to a zone in a layout. See Blocks for more details.

Auth – Are used to manage authorization (who can do what) of various Rock entities.

User – This represents the authenticated user viewing the website (or Rock application). It typically goes hand-in-hand with the Auth class.

Crm Entities

These entities are the parts that make up the Congregation/Customer Relationship Management layer of Rock. This includes the Person, Phone Number, Group, Group Member, Campus, etc. and other such things.

Campus – This is a name for the group of buildings that make up your church or organization.

Person – A person will generally have things like a PhoneNumber, UserLogin, etc. and be a GroupMember of a family (Group) as well as other types of groups.

Group – A group can be many things, but it's basically anything that has a collection of people (GroupMember) associated to it. They are hierarchical (a group can belong to (nested under) another group or it can have groups that belong to it. Typically a group will have a Campus and will also have one or more Location. Its GroupType will control various aspects of it's functionality and behavior.

GroupType – The group type specifies which GroupRoles are applicable and can also imply some other knowledge. For example, a "Family" group type may have group roles such as "adult" and "child", while a "Security Roles" group type may imply that it's corresponding collection of related groups are actually security roles. In the latter case, the members (GroupMember) of each group would indicate people who have that security role.

The flexibility of groups and group types is quite powerful once you understand how to use them.

Clone this wiki locally