Sofire V1.0 open-source -- remoting (1) of winform/SL/webform)

Source: Internet
Author: User
Sofire suite is a suite developed by individuals starting in August 2009. After several years of continuous optimization and improvement, from the initial v suite to sofire2011 to the current sofire. V1.0, sofire has experienced many project tests and accomplished its mission well. Now, I refactor this set of components, Try to make it the underlying preferred choice for any platform, framework, and suite . With the spirit of open source, I hope this set of components will continue to grow and mature in the discussion of bloggers.

So what does sofire. V1.0 contain?

1. Database Access (sofire. Data)

2. Fast dynamic reflection (sofire. Dynamic)

3. Efficient and brief binary serialization (sofire. serialization. binarysuite)

4. Remote Object Mode (sofire. datacomm. Remote)

5. Secure and Efficient socket (sofire. datacomm. Net)

6. aspect-oriented (sofire. AOP)

7. Because the first port of sofire V1.0 has not been fully transplanted yet.

To attract the attention of bloggers, I made a simple Silverlight-based remoting example. In this example, the reason for making the first open-source component is mainly to thank Boyou hpze2000 for its support and attention. In the previous article about vremoting Article (Click here to access) is already 2011-10-25 . But Boyou hpze2000 has been paying attention to this sample product. I have to say that due to work changes, this product will be released again after half a year. I am very sorry for this, we also hope that the examples and open-source frameworks demonstrated in the following sections will satisfy you. Let's take a look at the results: server startup Screen

Client execution Interface

Server Response Interface

Example

The example is very simple, but it contains four main modules:Socket,Remoting,DYNAMIC REFLECTIONAndSerialization.

Remote contract (okay, I'm lazy)
 
Namespace remotinginterfaces {public interface itest {double add (Double X, Double Y );}}
Contract implementation (well, I am really lazy)
Using remotinginterfaces; namespace sofiredemo1.test {public class Tester: itest {# region itest member public double add (Double X, Double Y) {return X + Y;} # endregion }}
Configuration file (defaultsetting. XML)
<? XML version = "1.0" encoding = "UTF-8"?> <Application name = "server" returnserror = "true"> <! -TCP: // localhost: 8001/One/helloservice. V -->  
Server Source Code
Public static result start () {remotingapplication. initialization ("defaultsetting. XML "); remotingapplication. applicationstatechanged + = new communicationstateeventhandler (remotingapplication_applicationstatechanged); remotingapplication. serverstatechanged + = new communicationstateeventhandler (remotingapplication_serverstatechanged); remotingapplication. clientjoined + = new eventhandler (remotingapplication_clientjoined); remotingapplication. clientquitted + = new eventhandler (remotingapplication_clientquitted); remotingapplication. clientinvoking + = new eventhandler (remotingapplication_clientinvoking); remotingapplication. clientinvoked + = new clientinvokedeventhandler (remotingapplication_clientinvoked); remotingapplication. clientfailed + = new clientfailedeventhandler (remotingapplication_clientfailed); Return remotingapplication. open ();}
Client source code
Public mainpage () {initializecomponent (); proxyfactory. register ("test", "TCP: // localhost: 8081/One/helloservice. V "," testsl "," 123456 ");} private void button#click (Object sender, routedeventargs e) {var I = proxyfactory. create (); MessageBox. show (I. add (double. parse (textbox1.text), double. parse (textbox2.text )). tostring (); proxyfactory. destroy (I );}
Conclusion

As you can see, this example is very simple and easy to use. It is applicable to any. NET development method. Whether it is winform or webform development, sofire will minimize your development cycle!

If you have sufficient support, you can publish it to an open-source website for sharing (Click here to download the source code ).

Why open source?

Closed-lock development is a very headache. In the long-term interests of individuals, if they want to make this set of components better, they need the joint efforts of countless friends. Any development kit without experience of baptism and application cannot reflect its deep value, and cannot bring it into another layer.

Open source, not for others, but for yourself. If you support this set of components, please do not mean your recommendation.

Serialization Efficiency

Old Version efficiency (see http://www.cnblogs.com/sofire/archive/2011/04/06/2000277.html)

This is the efficiency of the new version:

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.