Public Resource Management and Shared Subsystem - Public Resource Management Module

xiaoxiao2021-03-06  36

table of Contents

Abstract .............................................................................................. 1

I. Introduction .....................................................................................

(1) The meaning of developing public resource management and sharing systems ...................................................

(2) Profile application technology ...................................................................... .2

1. Introduction to Development Tools (Microsoft Visual Studio.NET, C #, SQL Sever)

2. Introduction to Key Technology ADO.NET

Second, demand analysis .............................................................................. 5

Third, database design .......................................................................... 6.6

Fourth, system design ................................................................................ 8

(1) Architecture ............................................................................ .8

(2) Detailed design of public resource management module ........................................................ .9

(3) part of the code of the data access layer .........................................................................

Five, conclusions ..............................................................................

Sixth, thank you .............................................................................................

7. Main reference literature and appendix ...............................................................................

(1) Main references ...................................................................................................

(2) Appendix .....................................................................................................................

Appendix 1: Relationship between the department and the students ............................................................... ... 15

Appendix 2: Permissions Controlled ER :............................................................................

Appendix 3: Architecture Diagram ....................................................................

Appendix 4: Calling process of resources in public resource management modules .................................... .17

Public resource management and shared subsystem

- Public Resource Management Module

Zheng Yafen

School of Computer and Information Science, Southwest Normal University, Chongqing 400715, China

Summary: Public Resource Management and Sharing System CRESource provides public data resources most commonly used in various application systems in MyCollege.NET, and application systems can be controlled by networks. Different application systems have different access rights for different resource types and resource properties. Such various application systems will have strong flexibility, developers can develop corresponding data access schemes for future operating environments (such as network conditions, etc.), reducing data redundancy, enhancing data updates Synchronous, cross-platform sexual aspects of data is used.

Abstract:. The system of common resource management & share provides common data resource for kinds of application systems in Mycollege.Net In control of qualification, application systems can use these data resource by network .Different application systems have their access qualifications for different resource types and resource attributions. So, programmers can flexibly develop various application systems and they also can design proper data access scenarios in according to the running environments in the future (eg the statements of network) .Besides these advantages, our system can reduce data redundancy, Enhance The Synchronization of the Data Update and Application Systems CAN Use Data in Different Develop Environments. Keywords Public Resources, Management, Sharing, Information, Permissions

I. Introduction

Public resource management and sharing system modules are completed by our team together. Among them, the public resource management module, database design and partial data access layer is completed by Zheng Yifen; public resource sharing module, authority control and some data access layer code is completed by Shuaikenna. Other work is completed by our two.

(1) Developing the meaning of public resource management and sharing systems

Public resource management and sharing systems are mainly managed on students' data and departmental information. Each management system in the school requires information on students or institutions. For example: library management system, school computer room management system, tuition fee management system, etc. If you have student information in the database of each management system, then the same work needs to be repeated. This will not only cause waste of resources, increase the difficulty of system development; and it is prone to data redundancy and inconsistent data access. We develop this system to address these problems.

The development of this system is based on WebService mode. The goal is to achieve centralized management of public resources, and public resources are implemented through networks in different systems and different platforms. Other management systems simply call the public call interface provided by this system to directly access the required public resource information, and there is no need to design this database. On the other hand, it is possible to avoid resource waste and data redundancy caused by public resource information, and also simplify the development of other management systems.

(2) Introduction to Application Technology

1. Development Tool Introduction

Microsoft Visual Studio.net is a full range of development platforms that use it to develop general applications, database applications, hardware drivers, or web-based applications. Visual Studio.net contains different languages ​​such as Visual Basic, C / C , and C #, and developers can choose from what language to be used as needed, of course, it also provides integrated functions between different programming languages, such as COM . In addition, in Visual Studio.NET, it also provides visual development environments, and you can quickly complete the interface design of the application. For this system we use C # in Visual Studio .NET as a development language.

C # is an object-oriented programming language. Its basic syntax is the same as C / C , which divides the logic of software development into 5 Most: Business Facade, Business Rules (Business Rules), Data Access Layer (DataAccess), Model layer, etc. This logic division makes the software development more convenient and separates the accesses of the statement and the database, and the business rule layer separates the rules separately for software extension and maintenance. Microsoft SQL Sever is a high-performance client / server relational database management system. There are many important new features, such as transparent distributed processing, concise management, object design interface based on object embedding and linking technology (0le), and integration with the Internet. The most important reason for choosing Microsoft SQL Sever is due to its scalability. Because Microsoft SQL Sever is a multi-threaded parallel database core, it can exert advantage of additional processors. In many cases, only support for symmetrical multiprocessing technology can be obtained using a specific parallel database and operating system. Of course, it also has high security and effectively protects user data.

2. Development of key technologies used in this system

The code written in this system fully adopts object-oriented programming idea, many of which are packaged and inherited. Our entire system mycollege.net uses. NET technology as the main development technology, as a module in myCollege.net - public resource management and sharing system, the functionality of its implementation determines the data required to manage The amount is very large, and it is also available to the user call. In order to ensure that users can efficiently and accurately call data, we use three-layer build mode and adopted ADO.NET technology in the data access layer.

Introduction to ADO.NET Technology

(1) ADO.NET programming foundation:

ADO.NET is an object responsible for data storage in the .NET Framework platform.

(2) What is ADO.NET technology and use?

ADO.NET is subsequent version of Active Data Objects2.6 (ADO). The main purpose of ADO.NET is to create a distributed data sharing app in the .NET Framework. ADO.NET is based on an XML industry, just like ADO, it provides a data access interface to communicate with OLE DB compatible data sources, such as SQL Server or Oracle. Applications can connect these data sources using ADO.NET and retrieve, process, and update data.

You may have learned ADO, then you have to learn new data access object model when you work in the old version. If necessary, you can use ADO in Net.Framework, but you need to pay some performance for COM layers. In addition, Net.Framework does not support COM Variant data types, which is the Field object in the Recordset object. Value data type, that is, if you use the ADO Recordset object in .NET, in order to access data, NetCLR often converts each field, if you want to access data, do these types of conversions will cause too much System overhead.

The most important reason to use ADO.NET is to obtain a truly disconnected data architecture and XML's tight intending and a universal data representation, you can combine data in various data sources and optimize and Database interaction features, the same part of ADO.NET and Net.Framework is closely integrated together, and take advantage of the layer structure and design patterns of all objects in Net.framework. ADO.NET is based on ADO, and many tools are provided for the data access tool set. (3) Features of ADO.NET

(a) ADO.NET uses a data structure that is not connected;

(b) Data is cached to the data set;

(c) The data set is independent of the data source;

(d) data remains XML

Data needs to move from the data store to the data set and move from the data set to various components, in ADO.NET, the format of traditional data is XML. Similarly, if data is required, store it as an XML, if there is an XML file, you can use it like any data source and create a data set from it.

In fact, in ADO.NET, XML is the basic format of the data, the ADO.NET data API automatically creates an XML file or stream in the data set, and sends them to another component, the second component can call similar The API reads XML back to the data set.

(e) Provide more conveniences based on XML based on XML, XML is an industrial standard format. This means that your application data component can exchange data with any other component other in any other application, as long as the component is understood as XML, many applications are written as understanding XML, providing unprecedented levels to exchange between heterogeneous applications .

XML is based on text. The XML representation of data does not use any binary information, which allows it to send through any protocol, and most firewall will block binary information, but by formatting information into XML, the component is still convenient to exchange information . For most scenarios, you don't have to know the data in ADO.NET without knowing XML. The ADO.NET automatically converts data into XML or XML as needed to automatically convert data to ADO.NET as needed, and interact with data using normal programming.

(f) Architecture definition data structure

Although you don't have to know anything about XML, you can read and write the database and data sets, but there are also things that use XML just the standard you pursue. In the case of data design, when the data is not intended to access the data, it is, using metadata in ADO.NET, will use XML.

The data set is expressed in XML. The structure of the data set uses an XML architecture to define, as the data contained in the data set can be loaded from XML to XML, and the structure of the data set can also be used as an XSD architecture from the XSD architecture and serialization.

Most of the operations in ADO.NET do not have to delve into the architecture. Typically, the Visual Studio.NET tool will be able to operate in a visual designer and generate and update the architecture as needed.

Second, demand analysis:

Function description

The public resource management and sharing system mainly completes the three functions of student information management, departmental information management and sharing rights control.

1. Student information management includes the following content:

(1) Student information: name, student number, gender, ID card number, professional, department, dormitories, dormitory address, home phone, surviving, home address, etc.

(2) Function module:

(a) Add information

(b) modify information

(c) Delete information

(d) inquiry information

2, the department information management includes the following:

(1) Department information: Contains the name, code, creating time, etc. The professional information is opened, including professional name, code, creating time, etc.

(2) Function module:

(a) Add information

(b) modify information

(c) Delete information

(d) inquiry information

3, access control:

All data access functions of the system will be disclosed to the outside through the network call interface, so that this is a pure open system. Different application systems can use data resources, but for different management systems, they are not the same as data permissions of this system.

(1) Permission control properties include: USID, resource type, attribute, readable, and writable of the application system.

(2) Function module:

Readable properties: only contain query operation permissions. By the two properties of the USID and resource types of the application system, the user can determine that the user can only perform the corresponding query function, and the query returns the type and quantity of the relevant data is also determined by the USID and resource types of the application system.

Writable properties: contains an operation permission such as query, add, delete, modify. By the two properties of the application system's USID and resource types, the user has the permissions of the user above the above-related operations, but also determines which information is performed by the USID and resource types of the application system.

Third, database design

Since this system is mainly controlled by students, the management of the department information is also controlled, the shared permission of the application system is also controlled, which involves the design of the physical database of the above three information.

1. Design of the department and student information database

(1) The first is two relationships between student information and department information, and their ER chase is like Appendix 1.

(2) The following description is performed in accordance with Appendix 1:

(a) a pair of relationships between colleges (TDEPTS) and Professional (TMAJORS):

TDEPTS (College Code DeptID, College Name DeptName), where the college code deptid is the master code;

TMAJORS (Professional Code Majorid, professional name majorname, college code DeptID), where professional code majorid is the master code, the college code deptid is the outer code.

(b) Professional (TMAJORS) and Students (TSTUDENTS) are a pair of relationships:

TSTUDENTS (Learn SNUMBER, Name Sname, Gender SEX, National Nation, Professional Code Majorid, Grade, Birthday Birthday, ID Card), Learn Snumber is the master code, professional code majorid is the outer code.

(3) List the following three sheets in accordance with the above analysis:

(a) Student Information Table (TSTUDENTS)

Column name

type of data

length

Whether it is allowed

PK

Snumber

nvarchar

20

N

Fk

Majorid

int

4

N

Sname

nvarchar

20

N

IDCARD

nvarchar

20

Y

Nation

nvarchar

10

N

SEX

nvarchar

10

N

Grade

int

4

N

Birthday

Datetime

8

Y

Student tables are used to store basic information about students. As shown in the table, students have eight basic properties, their attribute type, length and whether the empty table has been shown.

(b) College information sheet (DDEPTS)

Column name

type of data

length

Whether it is allowed

PK

DEPTID

int

4

N

Deptname

charr

50

N

The college information table is used to store basic information about the college. As shown in the table, the college has two basic properties. Its attribute type, length and whether there is an empty table have shown.

(c) Professional information table (TMAJORS)

Column name

type of data

length

Whether it is allowed

PK

Majorid

Int4

N

Fk

DEPTID

int

4

N

Majorname

charr

50

N

Professional information form is used to store professional basic information. As shown in the table, professional has three basic properties. Its attribute type, length and whether there is an empty table have shown.

2, the design of the authority information database

(1) The setting of this permission is to ensure that the external system is limited to public resources in this system.

(2) Its ER map is like Appendix 2.

(3) Perform the following description according to the above ER:

(a) TCONTROL represents the right to control this entity, which is associated with external systems accessed the system data resource.

(b) USID (principal code) represents the identity authentication of the application system, the Resource Type represents the property of the resource type. These two main code properties determine the user's control size for our subsystem resources.

(c) Attribute represents the individual properties of the data resource.

(d) Canread represents whether the user has the ability to have readable properties.

(e) CanWrite represents the user's ability to write this property.

Permission Control Form (TControl)

Column name

type of data

length

Whether it is allowed

PK

USID

int

10

N

PK

Resourcetype

nvarchar

50

N

Attribute

charr

40

N

Canread

Boolean

6

Y

Canwrite

Boolean

6

Y

Permission control mesh to store the shared permissions of the external system on the public resource in this system. As shown in the table, the permission control table has five basic properties. Its attribute type, length and whether there is an empty table have shown.

Fourth, system design

(1) architecture

In order to achieve two main functions of the system, we use three-layer design model: user interface layer, intermediate layer and physical database layer. Among them, the intermediate layer is also divided into: WebService layer, business façade, business rules, and database access layer (DataAccess). Business appearance layers and business logic layers can access database access layers. The business appearance layer is mainly for users, while the WebService layer is facing different application systems. The construction of this sub-system design structure refers to the architecture of the entire system, which is a simplification of mycollege.net architecture.

(1) Structure diagram is like Appendix 3.

(2) The following describes the following:

(a) Business Facade (BusinessFacade)

It is mainly to package the distributed business logic in the package application, which provides a simple-stateless interface to the user. It is actually a precise description of the demand in the function interface layer, ie the functions in this class class fully express the functions involved in the demand. Thus, once the layer is designed, the developer representing the layer can develop independent interface using this layer.

In our subsystem, it is mainly for users who call the public data resource management module. When a user operates the public data resource through the interface layer, the module first passes it to the business appearance layer, and then the business appearance layer passes the user's needs to the database access module so that the database access module performs the corresponding Operation, then the business appearance layer responds to the value returned by the database access module. If the operation is successful, return to the user, otherwise returns an error message.

(b) BusinessRules

The BusinessRules layer is mainly expressing business rules. In this sub-system module, it mainly sets the user's permission rules for data resource sharing.

(c) WebService module

The WebService module is an open function interface. It mainly facing the application system for sharing this sub-system data resource. When an application is called public resources through the WebService module, the module passes the requirements of the application system to the business logic layer. The business logic layer applies its rules to first determine its access rights. If the authority allows, the business logic layer will The application system is transmitted to the database access module so that the database access module performs the corresponding operation. The WebService module then responds to the value returned by the database access module. If the operation is successful, return to the user to the user, otherwise returns an error message. (d) Database Access Module (DA)

The main function of the database access module (DA) is to perform various operations directly to the database, such as adding new information to the database, deleting some of the information in the database, querying information and modifying information in the database, while executing The situation returns a corresponding value.

(e) Physical database

All public resources are stored in a physical database.

(2) Detailed design of public resource management module

The user is called by the user to the data resource in the public resource management module:

(a) See Appendix 4 in the calling process of resources in the public resource management module.

(b) as described below according to Appendix 4:

To add a new student, first enter the various information of the student to the user interface, and the user interface layer passes the received student information to the business appearance layer in the intermediate layer, which determines the validity of this information. If it is allowed, the business appearance layer is done to the database access layer. The database access layer adds the student record in the system database based on the information obtained, and returns an execution result. At this time, the business appearance layer analyzes the value returned by the database access layer to respond to the user interface layer.

(3) Part of the code of the data access layer

The code for the student information in the database access layer:

Namespace DataAccess

{

///

Summary of /// Students.

///

Public Class Students PUBLIC CLASS

{

Public students ()

{

//

// TODO: Add constructor logic here

//

}

Public Int Add (String Snumber, String Sname, String Sex, String Nation, String Major, Int grade)

{

/ / First, according to the professional name to find the corresponding professional number, prepare parameters for the following calls.

SQLParameter M = New Sqlparameter ("@ majorname", sqldbtype.varchar);

m.value = major;

SqlDataReader Reader = SQLHELPER.EXECUTEREADER (Daconfig.Connectionstring, CommandType.Text,

"SELECT Majorid from Tmajors where MajorName = @ Majorname", M);

IF (Reader.Read () == false)

Return 0;

INT Majorid = Reader.Getint32 (0);

/ / Prepare parameters for inserted data

Sqlparameter [] ms = new sqlparameter [6];

MS [0] = New Sqlparameter ("@ snumber", sqldbtype.varchar);

MS [1] = New Sqlparameter ("@ sname", sqldbtype.varchar);

MS [2] = New SQLParameter ("@ sex", sqldbtype.varchar);

MS [3] = New SqlParameter ("@ nation", sqldbtype.varchar); ms [4] = new SQLParameter ("@ majorid", sqldbtype.int);

MS [5] = New SQLParameter ("@ grade", sqldbtype.int);

MS [0] .value = snumber;

MS [1] .value = sname;

MS [2] .value = SEX;

MS [3] .value = nation;

MS [4] .value = majorid;

MS [5] .value = grade;

// Insert the database

int RET = SQLHELPER.EXECUtenonQuery (Daconfig.connectionstring, CommandType.Text,

"INSERT INTO TSTUDENTS (SNUMBER, SNAME, SEX, NATION, Majorid, grade) VALUES (@ snumber, @ sname, @ sex, @ nation, @ majorid, @ grade), ms);

Return Ret;

}

Public int Remove (String Snumber)

{

// Prepare parameters

SQLParameter M = New Sqlparameter ("@ snumber", sqldbtype.varchar);

M.Value = snumber;

//delete data

int RET = SQLHELPER.EXECUtenonQuery (Daconfig.connectionstring, CommandType.Text,

"delete from tstudents where snumber = @ snumber", m);

Return Ret;

}

Public int setsingleinfo (String Snumber, String Field, Object INFO)

{

IF (Field == "Majorname") // Handling special circumstances

{

/ / First, according to the professional name to find the corresponding professional number, prepare parameters for the following calls.

SQLParameter M = New Sqlparameter ("@ majorname", sqldbtype.varchar);

M.Value = info;

SqlDataReader Reader = SQLHELPER.EXECUTEREADER (Daconfig.Connectionstring, CommandType.Text,

"SELECT Majorid from Tmajors where MajorName = @ Majorname", M);

IF (Reader.Read () == false)

Return 0;

INT Majorid = Reader.Getint32 (0);

Sqlparameter [] ms = new sqlparameter [2];

MS [0] = New SQLParameter ("@ majorid", sqldbtype.int); // This uses the type of previous acquisition

MS [1] = New Sqlparameter ("@ snumber", sqldbtype.nvarchar);

MS [0] .value = majorid;

MS [1] .value = snumber;

//

int RET = SQLHELPER.EXECUTENONQUERY (Daconfig.Connectionstring, CommandType.Text, "Update TStudents Set Majorid = @ Majorid Where Snumr = @ Snumber", MS);

Return Ret;

}

ELSE // Treatment of general conditions

{

System.Type Type = NULL;

// First, you must get the data type of this property.

/ / This query returns all the data sets, the efficiency is very low, you should use a function to get the pattern of the table to improve

DataSet pre = SQLHELPER.EXECUtedataset (Daconfig.connectionstring, CommandType.Text,

"Select * from tstudents", NULL;

Foreach (Datacolumn col in pre.tables [0] .columns)

{

IF (columnname == inf)

{

TYPE = col.dattype;

Break;

}

}

Sqlparameter [] ms = new sqlparameter [2];

// Convert system data type to standard data type in SQL Server

MS [0] = New SQLParameter ("@" field, sqldbtypeconvert.converttype (type)); // This uses the previous acquired type

MS [1] = New Sqlparameter ("@ snumber", sqldbtype.varchar);

MS [0] .value = info;

MS [1] .value = snumber;

// query and return to the data set

int RET = SQLHELPER.EXECUtenonQuery (Daconfig.connectionstring, CommandType.Text,

"Update TSTUDENTS SET" Field "= @" Field "Where snumber = @ snumber", ms);

Return Ret;

}

}

Public Dataset getStudentBysNumber (String snumber)

{

// Prepare parameters

Sqlparameter [] ms = new sqlparameter [1];

MS [0] = New SQLParameter ("@ snumber", sqldbtype.nvarchar);

MS [0] .value = snumber;

String SQL = "SELECT * from vStudents where snumber = @ snumber";

// query and return to the data set

Return SQLHELPER.EXECUtedataset (Daconfig.Connectionstring, CommandType.Text, SQL, MS);

}

Public Dataset getStudentBysname (String sname)

{

// Prepare parameters

Sqlparameter [] ms = new sqlparameter [1];

MS [0] = New SQLParameter ("@ sname", sqldbtype.nvarchar);

MS [0] .value = "%" sname "%";

String SQL = "SELECT * from vStudents where sname like @sname"; // query and return data set

Return SQLHELPER.EXECUtedataset (Daconfig.Connectionstring, CommandType.Text, SQL, MS);

}

Public Dataset ListStudentsBymajor (String Major, int grade)

{

// Prepare parameters

Sqlparameter [] ms = new sqlparameter [2];

MS [0] = New SQLParameter ("@ majorname", sqldbtype.nvarchar);

MS [1] = New SqlParameter ("@ grade", sqldbtype.int);

MS [0] .value = major;

MS [1] .value = grade;

// query and return to the data set

Return SQLHELPER.EXECUtedataset (Daconfig.Connectionstring, CommandType.text, "SELECT * from vstudents where majorname = @ majorname and grade = @ grade", ms);

}

Public DataSet ListStudentSByDept (String Dept, Int grade)

{

// Prepare parameters

Sqlparameter [] ms = new sqlparameter [2];

MS [0] = New SQLParameter ("@ deptname", sqldbtype.nvarchar);

MS [1] = New SqlParameter ("@ grade", sqldbtype.int);

MS [0] .value = dept;

MS [1] .value = grade;

// query and return to the data set

Return Sqlhelper.executedata (Daconfig.Connectionstring, CommandType.Text, "Select * from vstudents where deptname = @ deptname and grade = @ grade", ms);

}

Public DataSet ListallStudentSbyGrade (int grade)

{

// Prepare parameters

Sqlparameter [] ms = new sqlparameter [1];

MS [0] = New SqlParameter ("@ grade", sqldbtype.int);

MS [0] .value = grade;

// query and return to the data set

Return SQLHELPER.EXECUtedataset (Daconfig.Connectionstring, CommandType.Text, "Select * from vstudents where grade = @ grade", ms);

}

Public Dataset ListallStudentSincollege ()

{

// query and return to the data set

Return SQLHELPER.EXECUtedataset (Daconfig.Connectionstring, CommandType.Text, "Select * from vstudents", null;

}}}

V. conclusion

All development processes of this system module are based on the idea and requirements of software engineering, demand analysis, system design, database design and coding are strict in accordance with objective analysis, and carefully design the purpose. This system is developed in the Microsoft Visual Studio.NET, which is developed based on .NET-based C # programming languages, while using SQL Server 2000 databases to develop and design the database.

Due to the time relationship, we only have a complete database and public resource sharing this block and integrate with other subsystems. The rights management logic layer in the public resource management module and the public resource sharing module has not been implemented.

Through this graduation design, we recognize the importance of the theory and practice, and learn to apply new technologies to solve problems, such as our development environment and programming language never have never been exposed in the previous study, but through access Data and programming practice, we have now a certain understanding of .NET's performance and C # usage techniques. In addition, we have also experienced a key role in the effective operation of work. These will benefit us in future learning and work.

Six, thank you

This graduation design can be successfully completed inseparable from our guidance.

Zou Xiangchun

Teacher guidance and help,

Lu Xinhong

teacher,

Chen Wu

teacher,

Smell

teacher,

Li Yun Gang

Teacher also gave great help in this process, expressing their sincere gratitude to their help. There is also a team of all members to support me, thank you for their heartfelt thanks!

Seven, main reference literature and appendix

(1) Main reference

[1] Guo Sheng.C # .NET programming, Tsinghua University Press, 2002

[2] Jiamu Studio. C # Programming Thought, Machinery Industry Press, 2003

[3] Van Rurai ..NET Data Service C # Advanced Programming, Tsinghua University Press, 2002

[4] Barwell .vb.NET Advanced Programming, Tsinghua University Press, 2002

[5] Zhang Li.SQL Server database principle and application tutorial, Tsinghua University Press, 2003

[6] Flash Dixin.SQL Server2000 Database Management, Beijing Hope Electronics Press, 2002

[7] Liang Fangming. SQL Server2000 Database Programming, Beijing Hope Electronics Press, 2002

(2) Appendix

Appendix 1: Relationship between the department and the student

Appendix 2: Permissions Controlled ER

Appendix 3: Architecture

Appendix 4: Calling process diagram of resources in public resource management modules

转载请注明原文地址:https://www.9cbs.com/read-74028.html

New Post(0)