If your knowledge is limited to responsive design for mobile development, this is far from enough.
As a developer, we have to deal with some old frameworks and add some new features. In order to not only better adapt to the needs, sometimes also for the convenience of better expansion. Share, this year to play the two different sites of the mobile expansion of the road, one is their own site, and a girlfriend in the construction of a search for interesting people, things, the site of things--looking for TA station.
Mobile development of a traditional website
For a traditional web site, just responsive is not enough, for the use of mobile phones, platform users, refresh is a bad experience. Here is an example of the framework of your own website (Phodal--geek's life), and the idea of refactoring is from the framework of a large website.
As shown,
The blog uses the Django-based Cms-mezzanine, the database is MySQL, and at some later time has been replaced by the SQLite3, limited by the performance of the server. Simply put, this is similar to the framework of a traditional website, with a simple background and foreground that can be easily extended to add new features.
For the average user, they can get used to the refresh on their own computer, and even if they don't refresh, they may feel like they haven't done anything. For the mobile side, refresh is a bad experience, not only to bring additional traffic, of course, there is a long wait. This can be well explained as responsive what in today's angularjs, mustache, and so on JS library so popular, because Ajax brings the advantages of too many implementations. For the mobile side with JS
- JavaScript programmers are easy to find (it seems to be for a background programmer, JS is also to be mastered).
- Just need to build a restful API
- How wonderful it is not to refresh
Although his shortcomings are quite many, the others are like
- Inconvenience in commissioning
- Learning curve
- Sometimes you have no way to handle some operating system-related events (such as Select).
For us to build our API here, all we have to do is build a restful interface that doesn't matter what kind of architecture we're using. The role of Nodejs and restify is equivalent to a microservices, with the characteristics associated with it, such as:
- The service itself is very simple, and each service focuses on doing one thing well;
- You can use the best and most appropriate tools in this location to build each service;
- Built in such a system is loosely coupled in nature;
- Multiple developers and teams can provide this mode relatively independently of each other;
- They are a great catalyst for continuous delivery, allowing frequent releases while keeping the rest of the system available and stable.
We can use different frameworks to do these things without having to think about other factors, what we have to do is develop independently. At this point, programmers who are responsible for moving the UI can also happily develop their development journey, rather than wait.
Mobile development and
In the construction of the TA station, at the beginning I wanted just a blog, can easily write a blog, at the same time can be extended, in addition to WordPress did not think of other blog system. So, it was a pleasure to pick one first WP Super Cache to speed up the opening of the site, as the cache is very good performance.
Because to develop a public query function, it is used WP-API , and a public platform--wechat-backend. And Wechat-backend is based on the Sinatra framework on Ruby, when we launch a query:
As shown, when we search for geek love , the request will be sent to the background, and then to request Wp-api, from the database after the query and then return.
Then we can see what we are looking for on the mobile client. For a query that does not have a result, it returns the parsed result of the blog's RSS, returning the most recent URL. Can be used in public search: Hongzhishushe, or can be directly scanned with QR code.
However, this can lead to many problems, one of which is the performance of WordPress and MySQL. However, using the existing framework optimization is a good choice compared to building a platform on your own.
Postscript
For the traditional website, application development, mobile application development is a challenge, we need to consider more things, and for the mobile platform, JavaScript is a better choice. Need to consider different factors, and traditional development is different from the front and rear separation of the trend is more and more obvious, backstage for the front desk is only a service exists.
Whether it is the mobile version of the website, or the corresponding platform, backstage for the foreground is only a service exists. And this kind of service is no longer just the traditional macro service, more is the micro service. The whole system is made up of tiny services that provide more powerful support for the system as a whole, and of course he has a lot of questions--"microservices architecture-not a free lunch".