it is a listserve project developed using design patterns like composite, proxy, observer, factory, singleton etc
/*** *-----------------------------------------SMALL DOCUMENTATION OF THE FLOW-------------------------------------------------
- Setting some basic data set
- reading json file for students and faculty data and adding same student and faculty data to alll department.
-
- Reading student and faculty data from json file by calling "getStudentListFromStaticData() and getStudentListFromStaticData()"
- We can add more faculty and students in json and code will add itself
- JSON files to read faculty and student data are: facultyDataList.json, studentDataList.json
*------------------------------------------------------------------------------------------------------------------------
-
- Creating 2 colleges : CSCM, LYLES
-
2.1 CSCM : Created 2 department in CSCM college
-
2.1.1 : Creating CSCI department in CSCM college and assigning faculty and student data
-
2.1.2 : Creating ECE department in CSCM college and assigning faculty and student data
-
2.2 LYLES : Created 2 department in LYLES college
-
2.2.1 : Creating Maths department in LYLES college and assigning faculty and student data
-
2.2.2 : Creating Physics department in LYLES college and assigning faculty and student data
-
-
- Created University object where CSCM and LYLES are stored.
- Some Abbreviations:
- Fac: Faculty, Stu: Student, dept: department,
- Impl: Implementation , clg: college
- Below is the tree structure of design
-
University(Fresno State) ----> can send alert and notification to everyone
-
/ \
-
/ \
-
CSCM(College) LYLES(COLLEGE) -----> can send notification to all or departments
-
/ \ / \
-
/ \ / \
-
CSCI(dept) ECE(dept) Maths(dept) Physics(dept) -----> can send notification to both fac and stu or either fac or stu
-
/ \ / \ / \ / \
-
/ \ / \ / \ / \
-
Stu Fac Stu Fac Stu Fac Stu Fac
-
-
- For announcement alerts i have tried to create following scenarios and many more can be easily integrated in future:
- 3.1 Do you want to send Emergency alert on behalf of Fresno State to everyone?
- 3.2 Do you want to send normal announcement on behalf of Fresno State to everyone?
- 3.3 Do you want to send an announcement on behalf of department to students and faculty?
- 3.4 Do you want to send an announcement on behalf of department to faculty only
- 3.5 Do you want to send an announcement on behalf of department to students only
- -> after selecting from choices, we are redirecting to Proxy design class (NotificationImpl).
-
Here, I have used PROXY design pattern to delay the message. Until a delay of 10sec we do not send announcement.
-
When delay is over notification is sent to observers by calling University send notification implementation.
-
Also, COMMAND pattern has been used inside NotificationProxyImpl. Here, I am asking user to take action if user
-
wants to cancel the notification. If user selects yes in 10sec than notification wont be sent and user is redirected to main men
- NOTE: Emergency notification service has been implemented where FRESNO STATE can send emergency alerts to everyone with no
- intruption or delay. *--------------------------------------------------------------------------------------------------------------------------
-
- Main Menu from which user can take action looks as follows:
- 4.1 Create new department
- 4.2 Enter new Student data
- 4.3 Enter new Faculty Data
- 4.4 Remove a Department
- 4.5 Remove Faculty Data
- 4.6 Remove Student Data
- 4.7 View all Faculty data
- 4.8 View all students data
- 4.9 View All available departments
- 4.10 Send Notification
*------------------------------------------------------------------------------------------------------------------------
- DESIGN Patterns and SOLIDS used:
-
- In future if required we can make console input for colleges and university details too to make it more dynamic.
-
- SINGLETON pattern is used in University(Fresno State)
-
- COMPOSITE design pattern is used to make tree hierarchy structure as shown above in tree diagram.
-
- PROXY design pattern is used to implement delay in sending announcements
-
- COMMAND design pattern is used to take user action to cancle the announcement untill announcement is sent.
-
- FACTORY design pattern has been followed to build core of project
-
- Every class have single responsibilty like notification is used to configure notification, main to take input, etc
-
- Liskov substitution is used along with following LAW of Demiter.
-
- This project follows open for extension with very minimum changes.
-
- Interface segeration has been used to implement single responsibility easily.
-
-
- Exception handling has been done to omit any unexpected failure
-
- Main class is the entry point of project
-
- Created data_objects_dao classes for Student, Faculty, College, Department, University so that some basic properties
-
of each object can be stored easily.
-
- User Interface:
-
- UI class in package user_interface has been created to consolidate user inputs and proper console display in one class. If in future we
- needs to implement from UI then we can use UI class as reference.
-
- NOTE: I am using students and faculty list as subscriber list. In future if required we can add subscriber list separatly.
*/
-
Main.class inside package main is the entry point of the application. Major documentation is in main class
-
Sample console input output looks as follows for reference:
||||||||||||||||||||||||||||||||BELOW IS THE SAMPLE INPUT OUTPUT OF THE APPLICATION|||||||||||||||||||||||||||||||||||||
Currently we have : 0 number of students and 4 number of faculties in total Do you want to view current student or faculty data? If yes choose from: 1. Student data 2. Faculty data 3. No Proceed to Main Menu 3 ...............................Department Metrics............................................ Current of CSCM departments count :2 Current of LYLES departments count: 2 ............................................................................................. ................................MAIN MENU OPTIONS............................................
- Create new department --- 2. Enter new Student data --- 3. Enter new Faculty Data --- 4. Remove a Department --- 5. Remove Faculty Data --- 6. Remove Student Data ---
- View all Faculty data --- 8.View all students data --- 9. View All available departments --- 10. Send Notification 10 ............................................................................................. SEND ANNOUNCEMENT MENU ............................................................................................. We have following ways to send notifications. Kindly enter your choice
- Do you want to send Emergency alert on behalf of Fresno State to everyone?
- Do you want to send normal announcement on behalf of Fresno State to everyone?
- Do you want to send an announcement on behalf of department to students and faculty?
- Do you want to send an announcement on behalf of department to faculty only
- Do you want to send an announcement on behalf of department to students only 3 ............................................................................................. Send normal announcement on behalf of department to students and faculty ............................................................................................. Please enter the announcement ji Please choose the department from which you want to send notification Departments available are: 1 CSCI 2 CSCI 3 MATHS 4 PHYSICS 3 dept ch 3 departmentListCSCM.size() 2 There will be delay timer of 10 sec to process the message. In the mean time do you want to cancel the announcement enter your choice when prompt appears Enter Y to cancel the announcement or Enter N if you don't want to cancel n Please wait until we process your request Can you confirm again do you want to cancel the announcement??(Y/N) n Time's up to cancel the announcement! Now the message will be delieverd -----------------STUDENTS---------------------- -----------------FACULTY---------------------- Notification received from MATHS Notification: ji Message delivered to sayam Notification received from MATHS Notification: ji Message delivered to sim Notification received from MATHS Notification: ji Message delivered to Pie Notification received from MATHS Notification: ji Message delivered to Gama You are in the main menu.Do you want to start over from main menu(Y/N)?