论文代写 留学生essay代写✔️各学科 英文论文代写
当前位置:以往案例 > >Essay
2023-01-04

Designing and Implementing Environment Monitoring System with CORBA



Table of contents

1. System Design 4

1.1 Design Overview 4

1.2 Main Components 5

1.3 Use Cases 5

1.4 Class Design 8

2. IDL Specification 10

3. Test and Evidence 12

3.1 Test: Start EnvServer 13

3.2 Test: Start One RegionalServer and Connect to EnvSever 13

3.3 Test: Start Another RegionalServer and Connect to EnvSever 14

3.4 Test: Start One MonitorServer and Connect to RegionalServer 14

3.5 Test: Start Another MonitorServer and Connect to RegionalServer 15

3.6 Test: Start AgencyServer 15

3.7 Test: Two MonitorServers and Connect to Two RegionalServers 16

3.8 Test: MonitorServer Send Readings to RegionalServer 16

3.9 Test: EnvServer Receives Readings from RegionalServers 17

3.10 Test: EnvServer Raises Alarm 18

4. Critique 19

4.1 Comparisons of Architectures 19

4.2 Alternative Solution 20

5. Source Codes 22

5.1 EnviromentalCentrelmpl 22

5.2 RegionalCentreImpl 24

5.3 MonitorImpl 27

5.4 AgencyImpl 29

5.5 EnvServer 30

5.6 RegionServer 34

5.7 MonitorServer 38

5.8 AgencyServer 43

6. References 46




1. System Design
1.1 Design Overview
As the company, i.e., Environmental Monitor asked for, we are going to design and implement an environment monitoring system with CORBA technology. In this proof of concept project, we are going to use following technologies for implementation.

1) CORBA: The Common Object Request Broker Architecture (CORBA) is a standard defined by the Object Management Group (OMG) designed to facilitate the communication of systems that are deployed on diverse platforms. CORBA enables collaboration between systems on different operating systems, programming languages, and computing hardware.

As you see, CORBA is a standard, which is easy to follow and supported by lots of different programming languages, which we will follow in this project for design and implementation.

2) Java Programming Language: Java is a general-purpose computer-programming language that is concurrent, class-based, object-oriented.

In this project, we will use Java language for CORBA implementation of the monitoring system. Because Java language is very popular, easy to learn and maintain, and the most important it has a very good support for CORBA.

3) Swing: Swing is a GUI widget toolkit for Java. Swing provides a look and feel that emulates the look and feel of several platforms, and also supports a pluggable look and feel that allows applications to have a look and feel unrelated to the underlying platform.

In this project, we will use Swing to provide a very simple user interface for interactions. Because Swing is actually de facto standard for implementing GUI in Java programming language, and it has a very concise look and feel.

1.2 Main Components
Based on the requirements of this project, and using OOP (object-oriented programming) design principles, we can extract and abstract several objects for this project.


This project mainly has following components, which will be further explained in the following sub sections.

1) EnvironmentalCentre: A singleton server pulling monitors data from RegionalCentres.

2) RegionalCentre: Servers pulling monitors data from Monitors, and raise alarms to EnvironmentalCentre.

3) Monitor: Small servers, which are used to monitor the environment status and collect environmental data, read current monitoring value and raise alarms to RegionalCentre.

4) Agency: Any entity interested in some regional center's data. It can be a person, an organization, and so on.

1.3 Use Cases
In this section, we will illustrate some UML diagrams, including use case diagrams and sequence diagrams to analyze the requirements in depth, which will help us to design and implement the system.


Fig 1.1 demonstrate how the Agency and Operator interacts with our Environment Monitor System. In general, the Operator can maintain the environmental centre and the regional centre (e.g., add monitor, turn on/off monitor, and so on); the Agency can raise alarms.

image.png

Figure 1.1. Use case diagram

Fig 1.2 shows how the messages are passed between Monitor and Regional Centre. If there are dangerous readings captured by the Monitor, it will raise alarm and notify Regional Centre.

image.png

Figure 1.2. Sequence diagram 1

Figure 1.3 demonstrates how the Regional Centre communicates with the Environmental Centre. Dangerous readings will be further passed to the Environmental Centre from the Regional Centre.

image.png

Figure 1.3. Sequence diagram 2


Fig 1.4 shows the overall communications between different components.


image.png

Figure 1.4. Sequence diagram 3

1.4 Class Design
image.png

Figure 1.5. Class diagram

Based on the before mentioned discussion, in this sub section we will present the detail design of this project.

In CORBA, we will have IDL specification (see next section for detail) which defines the interfaces, standing for the functionalities which will be provided by the system. Based on these interfaces, we will have several Java classes to implement the interfaces (i.e., class names are ended with “impl”). Each method in these implementation classes will be responsible for a specific function.

At the same time, we will have several classes for acting as CORBA servers (i.e., class names are ended with “server”).  All these classes have “main” methods, which are the initialize methods. And all these classes have references to the implementation classes.


Fig 1.5 shows the class diagram in this project. For details,

1) EnvironmentalCentreImpl: The implementation of the component EnvironmentalCentre described in section 1.2.

2) RegionalCentreImpl: The implementation of the component RegionalCentre described in section 1.2.

3) MonitorImpl: The implementation of the component Monitor described in section 1.2.

4) AgencyImpl: The implementation of the component Agency described in section 1.2.

5) EnvServer: CORBA server for Environmental Centre.

6) RegionServer: CORBA server for Regional Centre.

7) MonitorServer: CORBA server for Monitor.

8) AgencyServer: CORBA server for Agency.



2. IDL Specification
For IDL specification, we are following the requirements and putting all the IDL specifications into following file. As you can see, there are EnvironmentalCentre, RegionalCentre, and Monitor interfaces, as well as the struct Reading.

module EnvMon {
struct Reading {
long date, time, value;
string monitor;
};
interface Monitor {
readonly attribute string name;
readonly attribute string location;
Reading get_reading();
void turn_on();
void turn_off();
void reset();
};
typedef sequenceLogOfAlarmReadings;
typedef sequenceSetOfReadings;
interface RegionalCentre {
readonly attribute string name;
readonly attribute LogOfAlarmReadings log;
void raise_alarm(in Reading alarm);
SetOfReadings get_readings();
boolean add_monitor(in string name, in string location);
};
interface EnvironmentalCentre {
void raise_alarm(in Reading alarm);
void register_agency(in string who, in string contact, in string region);
void register_regional_centre(in string name);
SetOfReadings get_readings();
};
interface Agency {
readonly attribute string name, contact, region;
void raise_alarm(in Reading alarm);
};
};





3. Test and Evidence
In this section, we will use following tables with screenshots to demonstrate the tests have been done for this project.


The following main features are implemented in this project.

NO

Feature

1

Monitor can register itself with a Regional Centre upon initial activation.

Monitor can be switched on/switched off, and return current sensor value.

Monitor can send alarms to Regional Centre if the sensor value is very high.

2

Regional Centre can receive requests to register Monitoring Stations and maintains a list Monitors.

Regional Centre can receive alerts from connected Monitoring Stations. and maintains a log of these alerts

Regional Centre can trigger an alarm at the Environmental Centre when two alarms happen within a specified time frame.

Regional Centre can maintain the logs.

3

Environmental Centre can receive confirmed alarms from Regional Centres.

Environmental Centre can allow agencies to register for notifications in case of alarms.

Environmental Centre maintains a list of connected Regional Centres

Environmental Centre can poll all Regional Centres upon request and displays the results of readings returned, highlighting readings of concern.


3.1 Test: Start EnvServer
Expect Result

EnvServer can start successfully

Steps

Run command: java EnvServer

Test Result

Passed

Evidence

image.png


3.2 Test: Start One RegionalServer and Connect to EnvSever
Expect Result

First RegionalServer can start and connect EnvServer successfully

Steps

Run command: java RegionalServer region_server1

Test Result

Passed

Evidence

image.png


3.3 Test: Start Another RegionalServer and Connect to EnvSever
Expect Result

Second RegionalServer can start and connect EnvServer successfully

Steps

Run command: java RegionalServer region_server2

Test Result

Passed

Evidence

image.png


3.4 Test: Start One MonitorServer and Connect to RegionalServer
Expect Result

First MonitorServer can start successfully

Steps

Run command: java MonitorServer monitor1 location1

Test Result

Passed

Evidence

image.png


3.5 Test: Start Another MonitorServer and Connect to RegionalServer
Expect Result

Second MonitorServer can start successfully

Steps

Run command: java MonitorServer monitor2 location2

Test Result

Passed

Evidence

image.png


3.6 Test: Start AgencyServer
Expect Result

AgencyServer can start successfully

Steps

Run command: java AgencyServer agency_server 123456 location1

Test Result

Passed

Evidence

image.png


3.7 Test: Two MonitorServers and Connect to Two RegionalServers
Expect Result

MonitorServers can connect RegionalServers successfully

Steps

1. Start two RegionalServers as mentioned earlier

2. Start two MonitorServers as mentioned earlier

3. For each MonitorServer, input the RegionalServer which the MonitorServer wants to connect, and click “Connect”button

Test Result

Passed

Evidence

1538231007669101.png


3.8 Test: MonitorServer Send Readings to RegionalServer
Expect Result

RegionalServer can receive readings from MonitorServer

Steps

1. Start one RegionalServer as mentioned earlier

2. Start one MonitorServer as mentioned earlier

3. MonitorServer connects to RegionalServer as mentioned earlier

4. MonitorServer uses the scroll bar to send readings to ReginonalServer

Test Result

Passed

Evidence

image.png


3.9 Test: EnvServer Receives Readings from RegionalServers
Expect Result

EnvServer can receive readings from RegionalServer

Steps

1. Start one RegionalServer as mentioned earlier

2. Start one MonitorServer as mentioned earlier

3. MonitorServer connects to RegionalServer as mentioned earlier

4. MonitorServer uses the scroll bar to send readings to ReginonalServer

在线提交订单