🎒 Final Exam | 1st Semester | SDE & SCO
Private Movie Collection
Explore the docs »
A movie aficionado is buying and collecting movies in the mp4 format on an external 2 TB hard-drive. So far he has tried to use a system where he puts them in different folders, depending on their rating and the category of the movie. As the collection has grown the categories is becoming an increasing problem. Here we come with a solution !
- MSSQL Database
- T-SQL dialect
- MyBatis
- SL4J logging
- Build in caching
- Environmental variables
- Config file
- SQL Server Driver
- Movies
- CRUD
- Ability to play movie
- Get all movies
- Get all movies in category
- Create movie
- Update movie
- Remove movie
- Updating categories for movie
- Dynamic update in the interface
- Custom validation
- CRUD
- Categories
- CRUD impl
- Create Category
- Remove Category
- Updating categories for movie
- Dynamic update in the interface
- Build in drawer with dynamic categories
- Get all the movies when category assigned
- Custom validation
- CRUD impl
- API Contract
- Open source RESTful web service
- OpenFeign for smooth API calls
- Implemented feature to fetch possible movie title from open source api
- Dependency injection
- Implemented DI with Guice in order to write efficient/reliable code
- Dynamic sorting/filtering
- Table view with sortable columns
- Linear search algorithm
- Search movie by title,year,category
- Additional search feature for specifying rating
- Error handling
- Playable video formats
- Works on Windows
- Current issues with development environment and permission for mac users
- Implementation works as intended however only on window atm but the impl works and would work
- Feature to choose your own preferred movie player
- Initial warning feature requirement
- User will get the informational option to delete movie that are less than 6 rating and have not been seen for 2 years at the start
Our application was design by us in Figma
MSSQL Database diagram
- Singleton pattern
- Dependency injection pattern
- Factory pattern
- Publish-subscribe-style communication
- Data-access-object
- Service pattern
Example Method to retrieve movie by its category ID with com.movie_collection.dal.myBatis and SL4J
- Additional mapping included in Movie.xml
@Override
public Optional<List<Movie>> getAllMoviesInTheCategoryById(int categoryId) {
List<Movie> fetchedMovieInRole = new ArrayList<>();
try (SqlSession session = MyBatisConnectionFactory.getSqlSessionFactory().openSession()) {
MovieMapperDAO mapper = session.getMapper(MovieMapperDAO.class);
fetchedMovieInRole = mapper.getAllMoviesByCategoryId(categoryId);
} catch (Exception ex) {
logger.error("An error occurred mapping tables", ex);
}
return Optional.ofNullable(fetchedMovieInRole);
}
Dependency injection pattern example of injecting a model via class construct
private IMovieDAO movieDAO;
@Inject
public MovieService(IMovieDAO movieDAO) {
this.movieDAO = movieDAO;
}
RESTful web service to obtain movie information
- http://www.omdbapi.com
- API contract call to get movie by title
- Environmental variables / sensitive credentials handeling
- Custom logger stored in logs
public interface IMovie {
@Headers({"Content-Type: application/json","apikey: {apikey}"})
@RequestLine("GET /?t={title}")
MovieDTO movieByName(@Param("title") String title);
}
@Override
public RootController loadFxmlFile(ViewType fxmlFile) throws IOException {
final URL fxmlFileUrl = Main.class.getResource(fxmlFile.getFXMLView());
final FXMLLoader loader = new FXMLLoader(fxmlFileUrl);
loader.setControllerFactory(injector::getInstance);
final Parent view = loader.load();
final RootController controller = loader.getController();
controller.setView(view);
return controller;
}
- Implementation of a simple abstract class that set and retrieves Parent root object
public abstract class RootController implements IRootController {
protected Parent root;
@Override
public Parent getView() {
return root;
}
@Override
public void setView(Parent node){
this.root = Objects.requireNonNull(node, "view must not be null.");
}
}
Distributed under the MIT License. See LICENSE for more information.
Team: The Binary Aces
2023 SDE & SCO cs project posted here on GitHub.
Hope you will like it!
Thank you for your attention!
TTT ✒️
Tomas Simko - @twitter -simko.t@email.cz - @linkedIn
Patrik Valentíny @linkedIn
Nicola Martinez Clemente @linkedIn
Project Link: https://github.com/TomassSimko/Private-Movie-Collection