- Students have a
first name
,last name
,grade
and a collection ofmarks
. - Grades can be between
1
and12
. - Teachers have a
first name
,last name
and asubject
that they teach. They also poses the mighty power to add marks to students. Poor kids... - Marks have a
subject
and avalue
that can be between2
and6
.
The program takes as input commands
as strings. Each command consists of a name
and a collection of parameters
.
- CreateStudent [FirstName] [LastName] [Grade] - Creates a new student with the provided
first name
,last name
andgrade
and prints out a success message that contains thefull name
,grade
and theID
of the created student. - CreateTeacher [FirstName] [LastName] [SubjectId] - Creates a new teacher with the provided
first name
,last name
andsubject
and prints out a succes message that contains thefull name
,subject
and theID
of the created teacher. - RemoveStudent [StudentId] - Removes a student with the provided
ID
and prints out asuccess message
. - RemoveTeacher [TeacherId] - Removes a teacher with the provided
ID
and prints out asuccess message
. - StudentListMarks [StudentId] - Lists the marks of a student with the provided
ID
and prints out a list of marks in the formatSUBJECT => MARKVALUE
. - TeacherAddMark [TeacherId] [StudentId] [Mark] - The teacher with the provided
ID
adds a mark to the student with the providedID
with the providedvalue
.
- SchoolSystem.Data
Here is all the database related classes. Contains db context for entity framework (with an interface for abstraction), IRepository and IUnitOfWork with their implementations. Tests are located int SchoolSystem.Data.Tests
- SchoolSystem.Models
This project contains the application models, which also are a representation of the database structure.
- SchoolSystem.Factories
Contains interfaces for the factories, which create models. Because of Ninject's functionality (Ninject.Extensions.Factory) there are no implementation.
- SchoolSystem.Providers
Interfaces for IReader and IWriter that allow easy switching of input and output streams. Implemented with ConsoleReaderWriterProvider (uses command prompt). Also ICommandParser which parses the input and creates a suitable ICommand implementation.
- SchoolSystem.Services
Service layer for our application - contains ITeacherService and IStudentService interfaces for abstraction over the operations with different models. Also service implementations are there Service unit tests are located in the SchoolSystem.Services.Tests project
- SchoolSystem.Commands
Project contains the abstraction ICommand interface and the ICommandFactory. Also implementations for different commands are contained in this project. All command implementations are unit tested in the SchoolSystem.Commands.Tests project
- SchoolSystem.Core
This project contains the IEngine abstraction with the specific Engine implementation for running the application. It gets input from the injected IReader, parses and runs the command, and prints the output to the IWriter
- SchoolSystem.CLI
Console interface for the application. Contains a DbContextFactory for entity framework migrations (only used in development). SchoolSystemModule which is the configuration for our inversion of control container. Program.cs is the main entry point of the application (composition root).