- Introduction 💁
- Objectives 🎯
- UML Designs 🧭
- The Process ♟
- Ideas And Chalenges 🧠
- Creators 👩🏽💻
- Special Thanks to...🙏
- Resources 📚
This app is our final project for Advanced Programming course at Shahid Beheshti University. The program is based on Java and we also used some other languages such as CSS and Html.
The design pattern used for this project is MVC. For further information on this design pattern check the The Process section.
- Object Oriented Programming(OOP) Concepts
- Database Design
- Multithreading Concepts
- Socket Programming
- Designing Graphical User Interface With JavaFX
- Data Encryption
- Design Patterns
At the beggining of the projects, we had several meetings discussing different subjects such as:
- Which design pattern should we use?
There was a wide range of patterns we could use, patterns like Bridge, Abstract factory, Composite and so on. At last we picked MVC design pattern(short for model-view-controler).
MVC separates the different aspects of an application (data, UI, and logic), making the code easier to understand, maintain, and modify. Since the components are independent, changes to one component do not affect the others, allowing for easier updates and modifications and since the parts are seperated, multiple developers can work on different components simultaneously, which makes this pattern our finest option to work on as a group. - How to create our API?
We used gson library to send request and recieve response which let us exchange different objects easier and faster than normal string. - How should we manage the database?
Our database has been rewritten almost three times, adding new objects and attributes in each time. This database uses CRUD designing, short for create-read-update-delete.
We also used DTOs which is short for "Data Transfer Object" to make data exchange faster and more efficient. - Basic map of the program and division of labour
On this phase, the program was divided into Backend and Frontend. But in the process, we had a lot of time working on the same file or debuging two parts which were connected in functionality.
On this phase, we started designing all FXML views in the project, filling them with buttons and setting alerts and notifications.
- Mediaplayer
FIRST we used javafx mediaPlayer and expand it to the point that in video display, the slidebar on the bottom will fade automatically after a few seconds. You can also change video's rate or mute it. - Connecting controllers using fxmlLoader
About half of the program is being executed on our main panel. On this panel, we load other panels such as video view, channels, profile etc. - Alerts and notifications
In case to show some alerts, we used java's own notification class from controsfx library.
And besides our frontend, the connection our sockets and different part of program have is quite fascinating. The data exchange between server and client was a part where we could show our socket programming skills.
Bonus Features:
- server log
Every interaction that server does is being saved and written into a file so you can always access all we have done from the beginning till now. - Short videos
The difference between short and video is in size and the media player that plays the clip. - Comment like
- Some studio features
As said before, our design pattern is in MVC format. This design is built based on connections, like UI, interface with functions, and functions with database.
In client package, we have a Controller package which is full of controllers connected to our fxml View files. Also, there is a Model package including all DTOs and a network folder which includes classes that connect client to server using Request class as API, Downloader as a reciever for video files, FileTransfer thread, and Uploader class which is designed to send videos to server.
Since the server doesn't have anything to do with UI in this program, there is no voice
DTO stands for Data Transfer Object which is a design pattern. It is one of the EPA patterns which we call when we need to use such objects that encapsulate and aggregate data for transfer. A DTO is similar to a data structure, but like a data structure, it doesn't contain any business logic.
We use byte arrays to exchange videos between server and client. Every file transfer needs a FileTransfer thread which will be running parallel to our main threads, this system will let us load videos and images while loading an fxml panel.
However, since the server has nothing to do with user and view, the only package we have for server is a Model package including DTOs, a network package(kind of similiar to client network package), and a database including DatabaseManager and ClientService which connects and translates json objects sent by Request class.
Our API is built based on gson library which is a library for serializing/deserializing java objects to JSON and back.
In this program, we normally don't change scenes, most of panels are being loaded on the main panel and studio panel using FXMLLoader and passing controllers.
Each time the user logins, program builds(or if it already exists, reads) a file from program's cache. With each click on any thumbnail, updating the file using serialization.
Serialization in Java allows us to convert an Object to stream that we can save as file for later usage.
While a video is playing, every five second the file updates the video's last seen second.
- Amin Ghoorchian
- AmirAli Araghi
- Sepide Hoseini
- Teacher: Dr.SaeedReza Kheradpishe
- Head TA: Mahan Madani
- Mentor: Shayan Shahrabi