New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discuss Student Model #1
Comments
ContactNumber, GuradianName, ClassTeacher, CurrentClass, RoleNumber, |
FatherName,Fathers email and mobile and gender of student. |
|
I'd say the date of birth would be more applicable instead of age. |
I agree the date of birth is more dynamic than a static value that will require updating as time passes. |
@tajwal I wonder if these values should be in a different related entity, not directly in the main student entity. |
|
Mr @hassanhabib, Agrees with you In case when we wants to have more relatives of a student then we can have an entity which will have one to many relation with student and will store more information like relation(father, brother, mother,..), First name,Last name,mobile,email, and may be more columns. |
Better we separate the AuditFields from domain model like last 4 properties from the above student model. public class BaseEntity
{
public DateTimeOffset CreatedDate { get; set; }
public Guid CreatedBy { get; set; }
public DateTimeOffset UpdatedDate { get; set; }
public Guid UpdatedBy { get; set; }
} And whenever we need to use this just inherit the domain model from this base class. Like below. public class Teacher : BaseEntity
{
public string Name {get;set;}
} |
I think that there should be a list of contact people to reach out to in case of issues. Not even just the parents themselves, possibly grandparents or other people (maybe not even necessarily relatives) to be notified as well. I see this more as a m:n contact entity with contact type/relation to student. M;N for cases like having multiple children attending the same school. Can be simplified to 1:N if the identity of the contacts is not important (e. g. parent of child A is the same person as parent of child B) |
"StudentLevel" (first class , second third ..) BaseEntity could be like this also public class BaseEntity |
@ahmetsekmen better to make Id as 'Guid' only, rather than taking T as generic one. |
@MCCshreyas For users(admin,student,teacher..), guid is ok but what if other type of entities which they need audit properties. |
@ahmetsekmen Can you please provide example of other entity that you are trying to refer? That will be helpful for me to understand! |
@MCCshreyas Here is how we will use; For student; |
I guess we all agree that there should be a base entity with the given fields. Let's discuss what other properties do we need in the student entity itself. |
I guess guardians should be a separate entity itself, with courses, fees etc |
we may add Admission Date, BatchId/SessionId, StudentImageUrl |
@ahmetsekmen First a fall I need to highlight a thing that we should not use any domain specific property as primary key in database tables.
But let's say in future if school decided to swap those lessons, now they want Functions as first lesson, how will you do it now? As you have lessonno as primary key, you can't satisfy the new school requirements. That's what I want to highlight is that we should never ever consider domain properties as primary key for tables although it may be unique. So we should always have our extra property that can acts as primary key. |
Very good points from everyone - please note that we need to separate additional details entities from information that might be inseparable from the main entity, for instance, a student date of birth is inseparable information, their student identification number, but the guardians, contact information, teachers, classes all of this are related entities not part of the main entity we are trying to conceptualize here. Also about the audit fields, from my personal experience I highly recommend maintaining each model fields within the model itself, as @ahmetsekmen pointed out, I have run into situations where audit fields are different from one entity to the other - also keeping these fields in the same model file makes it easier to understand what the model entails without having to jump between two files to get the full picture about what a particular model represents - thoughts? |
@hassanhabib its just a one inheritance chain for Audit fields to domain. And also the data coming into this fields will be most likely from a common method most likely it will be So it's better to have common model for Audit rather than copying every single field to every single domain entity. Avoiding duplications. And also it's a single level inheritance, not much. |
@MCCshreyas would you entertain the idea of an interface of audit fields? this way consistency is enforced and duplication is only generated, yet visibility of any model's properties are all aggregated in one single file. you don't have to type the audit fields, something like: public interface IAuditable {
public DateTimeOffset CreatedDate {get; set;}
public DateTimeOffset UpdatedDate {get; set;}
}
public class Student: IAuditable {
public DateTimeOffset CreatedDate {get; set;}
public DateTimeOffset UpdatedDate {get; set;}
} |
@hassanhabib yeah it's OK. But does that mean that we need to copy and paste IAuditable to every single domain entity, I mean in its file!? 🤔🤔🙄 |
@hassanhabib Since we need to conceptualize 'foundational' student model, we should keep it simple. |
@MCCshreyas nope, you just implement it and that's it - you don't have to copy the interface it's written once and used everywhere |
Definitely - we need to consider the right to be forgotten as one of our priorities when it comes to data - everyone should have the right to have their data completely erased from any system - thank you for bringing this up, great point! |
We definitely are considering mobile and desktop apps - we want to allow people to have offline mode where they can manage their local data - save notes and then sync when they get back online. |
My final draft: public class Student : IAuditable
{
/// <summary>
/// PK
/// </summary>
public Guid StudentId { get; set; }
/// <summary>
/// Ref. to related IdentityUser
/// nvarchar(450)
/// </summary>
public string UserId { get; set; }
/// <summary>
/// Legal status of the student
/// eg. citizen, guest student, etc.
/// </summary>
//public string LegalStatus { get; set; }
/// <summary>
/// National Identity Number
/// </summary>
public string IdentityNumber { get; set; }
/// <summary>
/// Path or BlobName
/// Some DTOs may have Image or byte[] type fields
/// </summary>
public string Picture { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public DateTimeOffset BirthDate { get; set; }
/// <summary>
/// NotSpecified, Female, Male, Other
/// </summary>
public Gender Gender { get; set; }
/// <summary>
/// Nationality, etc other demographic properties can be tags
/// string or something like ICollection<Tag>...
/// </summary>
//public string Tags { get; set; }
//[Timestamp]
//public byte[] RowVersion { get; set; }
public DateTimeOffset CreatedOn { get; set; }
public string CreatedBy { get; set; }
public DateTimeOffset ModifiedOn { get; set; }
public string ModifiedBy { get; set; }
} |
Thank you everyone for your contributions, this is amazing - with the influence of each and every one of you here's the final model that we should start with: I think this is good enough, just few modifications: public interface IAuditable {
DateTimeOffset CreatedDate {get; set;}
DateTimeOffset UpdatedDate {get; set;}
Guid CreatedBy {get; set;}
Guid UpdatedBy {get; set;}
}
public enum Gender {
Female,
Male,
Other
}
public class Student : IAuditable
{
public Guid Id { get; set; }
public string UserId { get; set; }
public string IdentityNumber { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public DateTimeOffset BirthDate { get; set; }
public Gender Gender { get; set; }
public DateTimeOffset CreatedDate { get; set; }
public Guid CreatedBy { get; set; }
public DateTimeOffset UpdatedDate { get; set; }
public Guid UpdatedBy { get; set; }
} Now, let's talk about assignments: Setup
Broker
Service
Controller
Acceptance Tests
Few Rules:
If you haven't had an assignment this week please make sure you engage in discussion for next week so I know you are active in this repo and you are going to be able to contribute to the project. As soon as all these tasks are done, this issue will be closed. Thank you all from the bottom of my heart for your contributions, if you are stuck or unsure how to do a task, reach out to me literally on any social media platform you like, LinkedIn, Facebook, Whatsapp, Twitter or even Instagram or just ping me on gitter and I will be sure to response within 2 - 4 hours max. |
@hassanhabib will we allow all properties to be updated? |
@devmanzur yes, except of course the Id for obvious reasons |
Understood, Thank you. |
I will be working on the Delete Endpoint. Are we soft deleting or doing a physical delete?
|
I think that in only very exceptional circumstances it makes sense to delete something, if ever. How about a status property to both student and teacher? Something like that will be useful anyway when students leave the school for any reason. Not sure what the values would be, but maybe something like Registered/Active/Graduated/Cancelled |
Exactly! States and transitions (state machine) are very useful in school information systems. Like: |
@a-urel cool, I like "Candidate" better than "Registered" :-) |
@Mohamad-ali-8 that's a good point - however, we want to expose a private endpoint to clean out the database from any records for acceptance testing - soft-deleting will be part of the processing services not these broker-neighboring services, the deleting here is actually for the system not for end-users to be able to delete records. |
@a-urel That's a good idea, let's propose initial statuses for Students, here's a draft: public enum StudentStatus {
Candidate,
Enrolled,
Graduated,
Expelled,
Deactivated
} |
Actually these states indicate the student's relationship with an academic program, which is usually the exact same thing with student's status. But a student may be registered to both CS and MBA, simultaneously or not. I'm not sure if it's too early to consider these details. |
@a-urel we are not doing college just schools |
In some countries a school may include both primary and secondary school (or secondary and high school) stages.
First approach is simpler but the second one is more flexible. These are the educational stages we should support: |
@hassanhabib I think we can define OtripleS as K-12 software: Maybe another discussion issue would be useful, such as scope or big picture. |
@a-urel exactly, I do miss 2 important things on this project: (was considering to create an ISSUE to address this, but...)
|
Updating my Fork with latest Changes
We need to conceptualize what a foundational student model properties are supposed to have.
Currently I'm thinking of the following:
If you think we need to add more or remove some of the aforementioned properties let's discuss, let us know what you think.
The current model will be locked for development by the end of the week on 28th of June 2020
The text was updated successfully, but these errors were encountered: