|
| 1 | + |
1 | 2 | # A guild to Multi Threading vs. Multi Processing
|
2 | 3 | Research paper on Multi Threading vs. Multi Processing apply on Operating System & Application
|
| 4 | + |
| 5 | + |
| 6 | +# Automotive Customization System |
| 7 | +Automotive Customization System is an individual project using Java. The application allow multiple users get access to the server, and modify the data (which is cars) in the server. The application also allow each user to configurate their car and upload it to the server (please refer to the picture). The server and client object was implemented using Object Oriented Programing to encapsulate the design and access. Link Hash Map is used as the main container for this project (instead of a real database). The update data is write to a text file to simplifier the process. The container can be replace with a database system (SQL Server or My SQL), and will perform the full function of an API. Project can be extend to a full e-commerce page if the following component is add: a better GUI for the clients, payment API (Paypal), and a database system. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Technology: |
| 12 | +Java, Servlet, Object-Oriented Design, Encapsulation, Data Structures, Algorithm, Apache Tom Cat, Servelet, Client-Sever Implementation |
| 13 | + |
| 14 | +## Getting Started |
| 15 | +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | +What things you need to install the software and how to install them |
| 19 | +- Eclipse IDE: The Eclipse IDE is famous for our Java Integrated Development Environment (IDE), but we have a number of pretty cool IDEs, including our C/C++ IDE, JavaScript/TypeScript IDE, PHP IDE, and more. |
| 20 | +- Java Runtime Enviroment and Java Virtual Machine: Java software for your computer, or the Java Runtime Environment, is also referred to as the Java Runtime, Runtime Environment, Runtime, JRE, Java Virtual Machine, Virtual Machine, Java VM, JVM, VM, Java plug-in, Java plugin, Java add-on or Java download. |
| 21 | +- Apache Tomcat (called "Tomcat" for short) is an open-source implementation of the Java Servlet, JavaServer Pages, Java Expression Language and WebSocket technologies. Tomcat provides a "pure Java" HTTP web server environment in which Java code can run. |
| 22 | + |
| 23 | +### Installing |
| 24 | + |
| 25 | +A step by step series of examples that tell you how to get a development enviroment running. |
| 26 | +Download and Install Java (Java Runtime Enviroment or Java Virtual Machine) |
| 27 | +* [Java for Windows](https://java.com/en/download/) - we should download and install JVM before the Eclipse IDE |
| 28 | +Download and Install Eclipse IDE |
| 29 | +* [Install Eclipse IDE](https://www.eclipse.org/ide/) - If you haven't downloaded and installed Eclipse IDE yet, here's how to get started. |
| 30 | +* [Install Net Bean IDE](https://netbeans.org/features/index.html) - You can use either Eclipse IDE or Net Bean IDE, not need both. If you haven't downloaded and installed Eclipse IDE yet, here's how to get started. |
| 31 | +* [Install Apache Tomcat](https://tomcat.apache.org/download-80.cgi) |
| 32 | +There is other IDE that can run Java code, but we must download the JVM and Apache Tomcat for this particular project. |
| 33 | + |
| 34 | +## Running the tests |
| 35 | +Explain how to run the automated tests for this system: |
| 36 | +### Run Server and test if Server is function properly |
| 37 | +- Start server Server/driver/Driver.java |
| 38 | +``` |
| 39 | +package driver; |
| 40 | +
|
| 41 | +/* |
| 42 | + * |
| 43 | + * Author : Truc Huynh |
| 44 | + * Program : AutomotiveSystem |
| 45 | + */ |
| 46 | +
|
| 47 | +import java.io.IOException; |
| 48 | +import java.net.ServerSocket; |
| 49 | +import server.CreateServerConnectionToClient; |
| 50 | +
|
| 51 | +public class Driver { |
| 52 | +
|
| 53 | +public static void main(String args[])throws IOException |
| 54 | + { |
| 55 | + CreateServerConnectionToClient server = new CreateServerConnectionToClient(new ServerSocket(5555)); |
| 56 | + } |
| 57 | +} |
| 58 | +``` |
| 59 | +- Tested complete successfully. |
| 60 | + |
| 61 | +### Simultaneously create three clients and test if they are function properly |
| 62 | +- Start client Client/driver/Driver.java |
| 63 | + |
| 64 | +``` |
| 65 | +package driver; |
| 66 | +
|
| 67 | +/* |
| 68 | + * |
| 69 | + * Author : Truc Huynh |
| 70 | + * Program : AutomotiveSystem |
| 71 | + */ |
| 72 | +
|
| 73 | +import java.net.InetAddress; |
| 74 | +import java.net.UnknownHostException; |
| 75 | +import client.DefaultSocketClient; |
| 76 | +
|
| 77 | +public class Driver |
| 78 | +{ |
| 79 | +public static void main(String args[]) |
| 80 | + { |
| 81 | + String LocalHost = ""; |
| 82 | + try |
| 83 | + { |
| 84 | + //Get the LocalHost... |
| 85 | + LocalHost = InetAddress.getLocalHost().getHostName(); |
| 86 | + } |
| 87 | + catch (UnknownHostException e){ |
| 88 | + System.err.println ("Unable to find local host"); |
| 89 | + } |
| 90 | + DefaultSocketClient d = new DefaultSocketClient(LocalHost, 5555); |
| 91 | + d.start(); |
| 92 | + } |
| 93 | +} |
| 94 | +``` |
| 95 | +- Tested complete successfully. |
| 96 | + |
| 97 | +### Upload the data to Server (#1): |
| 98 | +- Create multithreading Server that can handle multiple clients. In Image 1, I run one server and three clients. The Server will receive a properties file (data) which upload by the client (#1), parse it, and store it on the server. (Validate data is successfully upload) |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | +- Tested complete successfully. |
| 103 | +- After client_T (#1) post (send) the text file (properties file) to the server. Server receive the properties file and parsed the text file to create an instance of Automobile and store it in the Link Hash Map (which is the application database) (Refer to Image 2). |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | +### Client Send Request to Server (Client #2) |
| 108 | +- Client-T (#2) send a request to the Server for cars configuration. Then Server will send the respond back (instance of Automobile). (Image 3) |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | +- Tested complete successfully. |
| 113 | + |
| 114 | +### Client Received Request from Server (Client #2, Client #3) |
| 115 | +- Client-T (#2) will get the choice from this instance of Automobile and store it within this Automobile. Picture below show successfully configurate the Car (Upload the data to server successfully) (Image 4) |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | +- Tested complete successfully. |
| 120 | + |
| 121 | +### Send and Received Request from Server (Client #3) |
| 122 | +- Call Client-T (#3) to configurate a Car after terminate Client-T (#2) to verify if the data is successful upload to the Server. (Image 5) |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | +- Tested complete successfully. |
| 127 | + |
| 128 | +### Conclusion |
| 129 | +The Server and Clients satisfy basic communication: send and receive request. Server receive upload data and store in its database (instance of Link Hash Map). The clients have ability to insert, update and delete an Automobile. Each test in the picture has been perform 30 to 40 times (depend on what tasks). There is crashing during the test with the Implementation of Exception Handling(helper class). |
| 130 | + |
| 131 | +## Deployment |
| 132 | + |
| 133 | +Can be deploy as web client and server that can handle multiple clients using Apache Tomcat. |
| 134 | + |
| 135 | +## Architecture UML Design |
| 136 | + |
| 137 | +### Client Diagram: |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +### Server Diagram: |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | +## Built With |
| 146 | + |
| 147 | +* [Java Virtual Machine](https://java.com/en/download/) |
| 148 | +* [Eclipse IDE for Windows](https://www.eclipse.org/ide/) |
| 149 | +* [Net Bean IDE for Windows](https://netbeans.org/features/index.html) |
| 150 | +* [Apache Tomcat](https://tomcat.apache.org/download-80.cgi) |
| 151 | + |
| 152 | +## Contributing |
| 153 | + |
| 154 | +Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us. |
| 155 | + |
| 156 | +## Versioning |
| 157 | + |
| 158 | +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags). |
| 159 | + |
| 160 | +## Authors |
| 161 | + |
| 162 | +* **Truc Huynh** - *Initial work* - [TrucDev](https://github.com/jackyhuynh) |
| 163 | + |
| 164 | + |
| 165 | +## Format |
| 166 | +my README.md format was retrieved from |
| 167 | +* **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth) |
| 168 | +See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project. |
| 169 | + |
| 170 | +## License |
| 171 | + |
| 172 | +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details |
| 173 | + |
| 174 | +## Acknowledgments |
| 175 | + |
| 176 | +* Hat tip to anyone whose code was used |
| 177 | +* Inspiration |
| 178 | +* etc |
| 179 | + |
0 commit comments