/UniversityListServe

it is a listserve project developed using design patterns like composite, proxy, observer, factory, singleton etc

Primary LanguageJava

UniversityListServe

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.
    1. 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

*------------------------------------------------------------------------------------------------------------------------

    1. 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
    

    1. 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
    

    1. 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. *--------------------------------------------------------------------------------------------------------------------------
    1. 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:
    1. In future if required we can make console input for colleges and university details too to make it more dynamic.
    1. SINGLETON pattern is used in University(Fresno State)
    1. COMPOSITE design pattern is used to make tree hierarchy structure as shown above in tree diagram.
    1. PROXY design pattern is used to implement delay in sending announcements
    1. COMMAND design pattern is used to take user action to cancle the announcement untill announcement is sent.
    1. FACTORY design pattern has been followed to build core of project
    1. Every class have single responsibilty like notification is used to configure notification, main to take input, etc
    1. Liskov substitution is used along with following LAW of Demiter.
    1. This project follows open for extension with very minimum changes.
    1. Interface segeration has been used to implement single responsibility easily.

    1. Exception handling has been done to omit any unexpected failure
    1. Main class is the entry point of project
    1. 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:
    1. 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.

*/

  1. Main.class inside package main is the entry point of the application. Major documentation is in main class

  2. Sample console input output looks as follows for reference:

||||||||||||||||||||||||||||||||BELOW IS THE SAMPLE INPUT OUTPUT OF THE APPLICATION|||||||||||||||||||||||||||||||||||||


----------------------WELCOME TO LIST-SERVE OF FRESNO STATE----------------------------------

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............................................

  1. 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 ---
  2. 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
  3. Do you want to send Emergency alert on behalf of Fresno State to everyone?
  4. Do you want to send normal announcement on behalf of Fresno State to everyone?
  5. Do you want to send an announcement on behalf of department to students and faculty?
  6. Do you want to send an announcement on behalf of department to faculty only
  7. 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)?