Silverlight application framework prototype: mvvm + WCF Ria service + business logic layer + self-written Entity Framework

Source: Internet
Author: User
Tags silverlight

After one month of study, from the access to Silverlight to the completion of a first-class application framework, it is indeed quite tired. Originally, the bottom layer was quickly finalized, but due to the long debate during the selection, it took some time, while I was only responsible for the bottom layer, but due to the slow progress of the client team (the reason is hard to say ), this week, I started to take over the work in this area. After several days of hard work, with the cooperation of the UI team, I finally completed the implementation of the entire application architecture from the database to the page, it works well and is suitable for large-scale development. The entire architecture is as follows:

Entity Framework: It mainly includes underlying database access and Entity Access encapsulation. It supports multiple types of database access and allows a single application (webapp) to access different databases at the same time. You can switch between them as needed. Objects (including presentation objects) can be automatically generated by tools, and object ing is implemented using metadata. Entity Access: dbcontext can automatically construct SQL statements for related operations. Complex queries can be executed directly using SQL statements. After a dataset is returned, it is encapsulated or processed in the business logic layer. Actually, it cannot inherit the base class, implement your own personalized data access method (for details about the Entity Framework, refer to my original blog post. It was just an anatomy. This time I basically implemented my own ideas. Of course, the difference between the cache and the database is just a simple process ).

Business logic layer: performs business logic processing. Basic business logic can also be generated using tools. The object attribute reference is also processed here. My object has two dictionary attributes: value reference and path reference. The advantage of processing here is that it is simple, and it is still troublesome to implement the client.

Wfcria service layer: two functions: security check and simple call of related business logic. Basic services are encapsulated in base classes. Specific service classes are mainly used to define non-standard services.

Client data service layer: responsible for dealing with the server.CodeGenerate.

Mvvm mode: a lightweight open-source class library from Microsoft. After a lot of transformation, we actually only use the message class of this framework.

VM: the attribute indexer binding function is widely used as a base class to implement most of the general business functions. Standard functions can also be generated by code.

There are few V: V codes, which are basically standard.

Today, the entire framework has achieved a standard implementation and the effect is good. I would like to commemorate it and thank my colleagues for their efforts. Of course, I also hope that my practices can be used for reference.

PS: in fact, many things can be encapsulated. Think about it or forget it. It's too tired.

 

Related Article

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.