Understanding the application's architecture
Every application has its own unique structure, or architecture. This architecture provides the overarching organization or framework for the application. For this application, we combine the three classes using a Java 8 stream in the ApplicationDriver
class. This class consists of three methods:
ApplicationDriver
: Contains the applications' user inputperformAnalysis
: Performs the analysismain
: Creates theApplicationDriver
instance
The class structure is shown next. The three instance variables are used to control the processing:
public class ApplicationDriver { private String topic; private String subTopic; private int numberOfTweets; public ApplicationDriver() { ... } public void performAnalysis() { ... } public static void main(String[] args) { new ApplicationDriver(); } }
The ApplicationDriver
constructor follows. A Scanner
instance is created and the sentiment analysis model is built:
public...