An Implementation Based on winform + Java WebService

Source: Internet
Author: User

How do you design an Online Shopping System for fixed customers?
Apparently, B/S The structure is no longer applicable. As long as the webpage is accessed through a browser, as long as you know URL If anyone can access the service, there will be no fixed customer restrictions.
So, C/S Structure? C/S The structure is indeed very suitable for LAN, but don't forget that our customers may travel all corners of the earth. (Of course, cannot connect Internet )
We should consider the following structure: Winform ( . Net ) + WebService ( Java).
WebService Protocol . Net And Java Both are supported, but there is a problem: the basic type can be passed between the two, but the reference type cannot be passed.
It doesn't matter. As long as strings can be passed, everything can be passed. The final solution is as follows:
When the client sends a request, it first serializes the object XML File, send the content to the server, and then the server XML The file is deserialized into an object. The same is true when the server returns the corresponding process.

At this point, the biggest obstacle has been solved. First, draw a rough flowchart:

1)It can be seen that the interaction between the client and the server usesXML, Object andXMLMutual conversion uses an Open Source component. For details, referHttp://java-cs-bridge.sourceforge.net/.

2)Server ReleaseWebServiceIs usedAxisBut we encapsulate it. All client requests call only oneService, Passed to thisServiceThe data includes its objects andService.

3)The server design imitatesStruts, EachService actionAll are called onlyLogic,LogicExecute the business logic.

4)Database Access is encapsulatedDbutils, Although notORMBut it can be flexible.SQLStatement.

5)In addition, only query is performed during the entire system operation, but the database is updated in a unified manner when the user completes or submits the operation. This ensures data uniformity, but it also brings some hidden risks: if the network is disconnected, the previous operations will not be saved to the database.

This design is distributed, pluggable, and flexible for servers and databases.

This is what I can think of. I hope you will not give me any suggestions or suggestions for improvement.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.