Game Hall starting from the Foundation (4)-by L2X with the configuration file Reflection assembly program (VB only)

Source: Internet
Author: User
Tags config reflection

It hasn't been updated for a long time. A while ago a more substantial work (is more tired pull ~), plus to the old Zhao study hard to thin body, the spirit of more pain, it is inevitable to lazy down. GM fell, the project suddenly died, on bench for one months, the more powerless.

The good news is also there, in the m$ MSDN Forum to answer questions, finally become a moderator. Although July to apply for the MVP failure but I am good at showing off, Nice is love to share, so a grunt to climb up, but also a hero.

-----------------------gossip ends here-----------------------

Using configuration to develop programs

Speaking of the configuration to establish procedures, have to mention ASP.net

Remember ASP.net membership's statement in Web.config?

<membership defaultprovider= "Main_sqlmembershipprovider" userisonlinetimewindow= ">"

<providers>

<add connectionstringname= "Gtscom_database_dataconnectionstring1" enablepasswordretrieval= "false" Enablepasswordreset= ' true ' requiresquestionandanswer= ' true ' passwordformat= ' clear ' applicationname= ' GTSCOM_ Customer "Name=" Main_sqlmembershipprovider "type=" System.Web.Security.SqlMembershipProvider "/>

</providers>

</membership>

Implement entity types that produce the same interface for different factories MembershipUser

Web.config is so magical that nothing is ever added to it. The compiler often generates temporary CS/VB code based on Web.config and compiles the results as a basis for the Web site.

Compiler config Enhanced performance I am very envious, but the change configuration to recompile such things are often criticized. Change a connection string the entire site compiles 5 minutes of complaining and occasionally hears.

Our game hall, whether it is to do the web game or to do the joint public, are not suitable for

The other way is to reflect.

L Hall Assembly requirements

n Dynamic loading of required class libraries (multiple game logic, room logic, replica type factory loading)

N Policy configuration (load of policy classes for policy mode)

N Modify the factory class and policy class with reload config to implement the "next game effective" configuration update without restarting.

N performance cannot be unduly affected

Okay, reflection is competent.

If the reflection gets all the factories that implement the Ifactory interface in the main program reference, all the objects that match the Iproductclass interface are returned, and the access members are performed through the access interface, and the performance is not affected by initialization. Looks very feasible!

On the other hand:

L Configuration File requirements

n Make this lazy egg easier to read (clear structure)

n Make this lazy egg easier to write (write Smart tips)

N Write a program when it is more comfortable (programming intelligence prompts)

Well, it's a thief in the eye.

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.