How ngdhuy/se_newspaper works
Project type and purpose
• Type: Desktop GUI application built with JavaFX
• Purpose: Load and parse RSS feeds from multiple newspaper “brands” and “categories,” then render the results in JavaFX screens.
File structure
• Controllers (src/main/java/io/setud/se_newspaper/controllers)
– MainScreenController, SplashScreenController: handle user events and view logic
• Views (src/main/resources/io/setud/se_newspaper/*.fxml + CSS)
– Two FXML files (Splash, Main), plus an extra heat-tab view and their styles
• Models (src/main/java/io/setud/se_newspaper/models)
– Brand, Category, Feed, News, plus a NewsPaperFactory
– Subpackages: “brands,” “categories,” and “concretes/[brand]/[category]” implement a family of RSS-parsers per brand & category
• Utility (src/main/java/io/setud/se_newspaper/util/Loader.java)
– Central FXML loader utility
• Entry point: Main.java
• Build and dependency management: pom.xml (Maven), module-info.java
Core components
a. JavaFX UI Layer
– SplashScreen.fxml + SplashScreenController
– MainScreen.fxml + MainScreenController
b. Application Core / Business Layer
– NewsPaperFactory: instantiates the correct concrete Feed parser based on selected brand & category
– Feed interface / abstract: defines loadRSS() or similar
– Concrete Feed implementations (e.g., VnExpressBusiness, VnExpressSports, ThanhNienCovid, etc.)
– Domain models: News, Feed, Category, Brand
c. Utility
– Loader: FXML loader & resource manager
d. External Services
– RSS endpoints (one per brand/category combination)
Relationships & data flow
– User launches Main → Main.java
– Loader loads SplashScreen.fxml → SplashScreenController
– After splash, Loader switches to MainScreen.fxml → MainScreenController
– MainScreenController captures user’s brand & category choice
– Controller calls NewsPaperFactory.getFeed(brand, category)
– Factory returns a ConcreteFeed instance (e.g., VnExpressSports)
– ConcreteFeed.fetchRSS() contacts external RSS URL → parses XML → produces List<News>
– Controller receives List<News> → binds it to JavaFX UI components (TableView, WebView, etc.)
Architectural patterns & principles
• MVC (JavaFX):
– Model = domain objects + factory + concrete parsers
– View = FXML + CSS
– Controller = MainScreenController, SplashScreenController
• Factory Method: NewsPaperFactory decides which parser to instantiate
• Separation of concerns: UI, business logic, parsing logic, and utility are clearly split
• Single desktop‐process with no database; all data comes from external RSS services