This project is a school level innovation training project of the University of engineering and software institute that I applied for at the beginning of the year. The inspiration of the project comes from a member of our original Microsoft team. At first, I wanted to work together to complete the project. For some reasons, he had to quit. So the choice of technology stack, front-end layout, business process, database structure and so on are all explored by me from scratch. The real start time of this project is about August 2017, and now it has come to a confused period, so I decided to put my ideas into the document, hoping to get some ideas. It is a record, but also a plan and exploration.
Project brief introduction
University astronomy sharing platform hopes to provide university students with a one-stop platform with functions such as sky forecast, popular science knowledge, University Group observation activities, picture and log sharing. I hope to track the recent astronomical observation events, help students from different schools in the best observation zone to host and participate in offline observation activities, and record the details of the activities.
- Registration and login
- Friend add
- Blog publishing
- Picture upload
- The capture and push of celestial information
- The host and participation of University observation activities
- The grasp and arrangement of astronomical knowledge and pictures
Architecture from August to December
- Bootstrap - jQuery
- servlet - tomcat
- Ajax - json
-MySQL (information) -Server path (file)
Problems in the above architecture
Front and rear ends are not separated
Java Web uses JSTL and El expressions, which leads to poor separation of front and back ends. After contacting Ajax, it likes the feeling of separation of front and back data, but the previous code has not been refactored in this direction, which is confusing.
There are many basic functions that need to be implemented by yourself
For example, the upload and download of files requires a lot of extra code to process with Java Web.
There’s a problem with filter that hasn’t been solved
There has been a problem with my cookie filter. When the program runs to this filter, it will not move. Even the println written in the first line is invalid.
I think JSP compilation is too slow
Every time the whole environment has to be recompiled, and small adjustments to JSP have to be made again, which is especially inconvenient when debugging the front-end effect. And bootstrap is in IntelliJ
There is an unexplained bug in Java Web project of idea. I have to write a reference to bootstrap.js and jquery.js respectively in the template of header and footer that every JSP will insert to ensure the normal operation of the drop-down box in bootstrap.
The front-end generation of complex DOM is very energy consuming
In order to dynamically generate a DOM by jQuery for each image loaded, and there are multiple nesting and attribute assignment in the DOM, I have to write dozens of lines of almost no technical content code.
At present, I have encountered problems with Java Web and found various blogs many years ago. Moreover, I seldom write java web projects with pure servlets. Basically, either struts 2 or spring is not used in this project. The reason why struts 2 is not used in this project is that I tried it before, but I encountered problems in configuring struts 2 interceptors for a long time and failed to solve them. As a result, I gave up and went back to servlets 。
- Registration and login
- User profile page
- Upload and download user album pictures
- Forum post reply operation
Plan for December
- In order to achieve real front-end and back-end separation, the front-end is a pure HTML page, with the help of react to achieve a more convenient and powerful front-end JS effect
- Use restful way to build the interaction between front and back end, and build a more concise address bar (learn GitHub)
- Backend uses spring MVC Architecture (want to try new technology)
- Rewrite and improve the relevant code of forum posting provided by Haoran (although I haven’t been able to run this part of his code yet)
- Complete the user’s log publishing (use the combination of markdown and user album picture link to solve the problem that markdown can’t upload pictures directly)
- Complete the attention among users (in fact, it is not very complicated)
- Make up some activities to complete the campus’s hosting and participation in the activities (the schools with the largest number of students want to participate will get the right to host, and other schools can decide whether to participate in the activities in an official form according to the degree of students want to participate)
Small steps to achieve the December target
- First, skip the previous filter problem and run the code of the giant. It’s the first thing to run it
- Quickly understand the restful design pattern, find out the interaction mode between request and data at the front and back ends, and then plan a new back-end structure
- Using spring MVC design pattern to quickly migrate existing code
- Use the simplest and sufficient page layout, make all other front-end requirements pages first, and arrange the interface with the back-end interaction
- In order, complete markdown blog writing and publishing, users pay attention to each other, push user blog on the home page, push activity registration function on the home page
I’ll debug the code of Haoran first! Come back when you’re done!
GitHub’s address is not easy to put out now, and I’ll post it after I’ve reconstructed it to share with you:)