Create pipe-and-filter network that will read data stream

Assignment Help JAVA Programming
Reference no: EM13908819

Problem Description

The objective of this assignment is to develop an appreciation of architectural patterns/styles and their impact on systemic properties. This assignment will use the pipe-and-filter architectur- al pattern as an exemplar. Part of this assignment will be implementation-oriented, allowing you to experiment with a particular pipe-and-filter implementation strategy in order to gain a clearer understanding of the issues associated with carrying an architectural design through to code.

Note that this is not a programming class, and so the emphasis of this assignment is on the ar- chitecture issues - this cannot be stressed enough. Simply re-writing the entire implementa- tion will indicate a lack of understanding of the core architectural concepts presented in class.

The assignment consists of two parts: For the first part of the assignment, you will be provided with an architectural design for two sample systems together with working implementations that use a (coding) framework supporting the pipe-and-filter paradigm. The class of system for this assignment is signal processing applications, as described below. Your task in part one is to extend the existing framework to architect and build the systems specified in the requirements below. Part one will be done in teams.

The second part of the assignment consists of analyzing the architecture of the system. After your analysis, design, and coding, you will reflect upon your work and answer questions related to the design decisions your team made in part one. While you may discuss part two as a group, the write-up for part two must be done individually.

Business Context and Key Architectural Approaches

The principle stakeholder for this system is an organization that builds instrumentation systems. Instrumentation is a typical kind of signal processing application where streams of data are read, processed in a variety of ways, and displayed or stored for later use. A key part of modern instrumentation systems is the software that is used to process byte streams of data. The or- ganization would like to create flexible software that can be reconfigured for a variety of applica- tions and platforms (for our purposes, we can think of "platforms" as processors). For example, one application might be to support instrumentation for an automobile that would include data streams that originate with sensors and terminate in the cabin of the auto with a display of tem- perature, oil pressure, velocity, and so forth. Some subset of filters for this application might be used in aviation, space, or maritime applications. Another application might be in the lab reading streams of data from a file, processing the stream, and storing the data in a file. This would support the development and debugging of instrumentation systems. While it is critically impor- tant to support reconfiguration, the system must also process streams of data as quickly as possible. To meet these challenges, the architect has decided to design the system around a pipe-and-filter architectural pattern. From a dynamic perspective, systems would be structured as shown in the following examples.

1122_JAVA Programming.png

The "data sources" in these systems are special filters that read data from sensors, files, or that generate data internally within the filter. All filter networks must start with a source. The "filters" shown in these examples are standard filters that read data from an upstream pipe, transform the data, and write data to a downstream pipe. The "data sinks" are special filters that read data from an upstream filter, but write data to a file or device of some kind. All filter networks must terminate with a sink that consumes the final data. Note that streams can be split and merged as shown in these examples.

The organization's architect has developed a set of classes to facilitate the rapid development of filters and applications that can be quickly tested and deployed. These libraries have been pro- vided to you. In addition there are several examples that have been provided to illustrate the use of these classes. The class structure (static perspective) for filters is as follows:

1149_JAVA Programming1.png

The FilterFramework class is the base class for all filters. It contains methods for managing the connections to pipes, writing and reading data to and from pipes, and setting up the filters as separate threads. Three filter "templates" have been established to ease the work of creating source, sink, and standard filters in a consistent way. Each of these filter templates describes how to write code for the three basic types of filters. Note that the current framework does not support splitting or merging the data stream. A fourth template, called the "PlumberTemplate" shows how pipe-and-filter networks can be set up from the filters created by developers. The "Plumber" is responsible for instantiating the filters and connecting them together. Once done with this, the plumber exits.

Data Stream format

The system's data streams will follow a predetermined format of measurement ID and data point. Each measurement has a unique id beginning with zero. The ID of zero is always associated with time. Test files have been provided that contain test flight data that you will use for the project. The file data is in binary format - a data dump tool is provided to help read these files.
The table below lists the measurements, IDs, and byte sizes of the data in these files.

Data in the stream is recorded in frames beginning with time, and followed by data with IDs from 1 to n. A set of time and data from 1 to n is called a frame. The time correlates to when the data in the frame was recorded. This pattern is repeated until the end of stream is reached. Each frame is written in a stream as follows:

Installing the Source Code

First, unzip (using WinZip, for example) the "A1 Source.zip" file into a working directory. You will see five directories: Templates, Sample1, DataSets, HexDump. The Templates directory con- tains the source code templates for the filters described above. The DataSets directory has all of the test data that you will need. The directory HexDump contains a utility that will allow you to read through the contents of the binary data files. The directory Sample1 contains a working pipe-and-filter network example that illustrates the basic framework. To compile the example in the Sample1 directory, open a command prompt window (or start a Linux command line termin- al), change the working directory to Sample1, and type the following:

...\assignment1\sample1> javac *.java

The compile process above creates the class files. After you compile the system, you can ex- ecute it by typing the following:
...\assignment1\sample1> java Plumber

Sample1 is a basic pipe-and-filter network that shows how to instantiate and connect filters, how to read data from the Flightdata.dat file, and how to extract measurements from the data stream.

The output of this example is measurement data and time stamps (when each measurand was recorded) - all of this is written to the terminal. If you would like to capture this information to assist you in debugging the systems, you can redirect it to a file as follows:
...\assignment1\source> java Plumber > output.txt In this example, the output is redirected to the file output.txt.

Part 1: Design and Construction (TEAM TASK)

The task of your team is to use the existing framework as the basis for creating three new sys- tems. Each new system has one or more requirements. In each system, please adhere to the pipe-and-filter architectural pattern as closely as possible. Make sure that you use good pro- gramming practices including comments that describe the role and function of any new mod- ules, as well as describing how you changed the base system modules. If you do not follow rea- sonably good programming practices, your team will be penalized.

System A

Create a pipe-and-filter network that will read the data stream in FlightData.dat file, convert the temperature measurements from Fahrenheit to Celsius, and convert altitude from feet to meters. Filter out the other measurements and write the output to a text file called OutputA.dat. Format the output as follows:

the output as follows:

Time: Temperature (C): Altitude (m):

YYYY:DD:HH:MM:SS

System B TTT.ttttt AAAAAA.aaaaa

Create a pipe-and-filter network that does what System A does but includes pressure data. In addition, System B should filter "wild points" out of the data stream for pressure measurements. A wild point is any pressure data measurement that exceeds 80 psi, or is less than 50 psi. For wild points encountered in the stream, extrapolate a replacement value by using the last known valid measurement and the next valid measurement in the stream. Extrapolate the replacement value by computing the average of the last valid measurement and the next valid measurement in the stream. If a wild point occurs at the beginning of the stream, replace it with the first valid value; if a wild point occurs at the end of the stream, replace it with the last valid value. Write the output to a text file called OutputB.dat and format the output as shown below - denote any extrapolated values with an asterisk by the value as shown below for the second pressure mea- surement:

Time: Temperature (C): Altitude (m): Pressure (psi):
YYYY:DD:HH:MM:SS TTT.ttttt AAAAAA.aaaaa PP:ppppp
YYYY:DD:HH:MM:SS TTT.ttttt AAAAAA.aaaaa PP:ppppp*
YYYY:DD:HH:MM:SS TTT.ttttt AAAAAA.aaaaa PP:ppppp
: : : :

Write the rejected wild point values and the time that they occurred to a second text file called WildPoints.dat using a similar format as follows:
Time: Pressure (psi):
YYYY:DD:HH:MM:SS PP:ppppp

Create a pipe-and-filter network that merges two data streams. The system should take as input the SubSetA.dat file and the SubSetB.dat. Both of these files have the same 5 measurements as FlightData1.dat, which was recorded at different, but overlapping times. The system should merge these two streams together and time-align the data - that is, when the files are merged the single output stream's time data should be monotonically increasing. This is illustrated below with a simple example. Here Stream C represents the merger of Stream A and Stream B.

1811_JAVA Programming2.png

In addition to merging the streams, you must filter the resulting data stream (Stream C) as follows:

1) Filter out pressure measurement wildpoints where the value exceeds 90 psi, or is less than 45 psi (yes this is intentionally different from System B). Write these values to a "rejected" file as required in System

B. Replace any filtered wildpoints with extrapolated values as you did in System B.

2) Filter out all measurements where: attitude ex- ceeds 10 degrees and pressure exceeds 65 PSI and write them to another file using the same format used in System B. Replace any filtered wildpoints with extrapolated values as you did in System B.

Packaging and submitting Part 1

- Systems A, B, and C should be clearly separated, both in terms of implementation and write- up (as described above). Place each implementation in a different folder for each of the sys- tems.

- Part 1 must be emailed in a zip file following the following format TEAM- NAME_ASSIGNMENT-NUMBER_YEAR to the appropriate TA.

- We will test your programs on our computers with test data sets that are the same or similar to the data sets you have be provided with. You must clearly describe how to run your pro- gram. PLEASE DO NOT ASSUME THAT WE HAVE ANY PARTICULAR RUNTIME ENVI- RONMENTS INSTALLED ON OUR SYSTEMS. WE WILL NOT INSTALL RUNTIME ENVI- RONMENTS ON OUR SYSTEM TO RUN YOUR PROGRAMS. We will run your programs from the command window - so please keep this in mind. In general, we will not recom- pile your code on our machines. If we cannot figure out how to run your program, you will be penalized. If you have any questions, please ask.

Part 2: System Analysis (INDIVIDUAL TASK)

Cooperation Notes: Even though the systems were developed by the team, you are free to agree or disagree with your team's implementation decisions in your individual write-up. You may use the team diagrams in your individual write-up. Feel free to alter the team diagrams in your individual write-up to support your analysis. You should not share any diagrams you create individually with your teammates. Please include your team name in your individual write-up to facilitate its cross-referencing with the team tasks:

Please answer the following questions. Each question has several parts. Make sure that you answer each question completely in your write-up:

1. For the overall system discuss the following:

• According to the business context, what are the key architectural drivers of the sys- tem and what is their relative priority?

• How well do the architect's initial structural choices (the use of a pipe-and-filter archi- tectural pattern and the provided filter framework) support the business goals as de- scribed in the business context?

2. For each system A, B, and C:

• Describe the architecture of the system. Be sure to include appropriate views of the system. You are free to use whatever notations you prefer, but you must follow good standards of architectural documentation.

• Discuss how well the design choices that you made support the business goals of the system in terms of the relevant quality attributes. What were the key design deci- sions, tradeoffs, and what motivated your choices?

• Are there any other possible solutions that you could have adopted? What made you decide on your solutions over these other possible solutions?

3. Given your design and implementation of pipe-and-filter systems used for this assign- ment:

• To what extent do your implementations (A, B, and C) differ from what is implied by an idealized notion of pipes and filters? Explain why and the impact it might have on systemic properties of your systems.

• Is it possible for a developer to create circular dependencies in your systems? If so, what might be the result of executing a system with circular dependencies?

4. Extension 1 (you are not required to implement this extension; however, describe the system in sufficient detail so that the architecture can be understood):

• Suppose that each filter needed information about each measurement. How might you pass along measurement metadata to each filter that included descriptions of the measurements such as measurement byte size, ID, units, and so forth? How might you satisfy this requirement? Sketch the architecture of this system, describe, and justify your design decisions and analysis.

• How would this impact the key quality attributes of the system? How would the exist- ing framework be affected? What mechanisms of the existing system might be af- fected by this requirement?

• Would this system deviate from the idealized notion of a pipe-and-filter pattern? Ex- plain why or why not and justify your answer.

5. Extension 2 (you are not required to implement this extension; however, describe the system in sufficient detail so that the architecture can be understood):

• Suppose there is a new requirement to run filters on separate processors as well as supporting co-located filter networks. How might you satisfy this requirement? Sketch the architecture of this system, describe, and justify your design decisions and anal- ysis.

• How would this impact the key quality attributes of the system? How would the exist- ing framework be affected? What mechanisms of the existing system might be af- fected by this requirement?

• Would this system deviate from the idealized notion of a pipe-and-filter pattern? Ex- plain why or why not.

Reference no: EM13908819

Questions Cloud

Pak company manufactures and sells mountain bikes : PAK Company manufactures and sells mountain bikes. It normally operates eight hours a day, five days a week.
About the retirement account : Carla Lopez deposits $7980 a year into her retirement account. If these funds have an average earning of 3 percent over the 19 years until her retirement, what will be the value of her retirement account?
Show that no unbiased estimate of x exists observation of y : Let Y = X2 + Z, where Z is a zero-mean unit variance Gaussian rv. Show that no unbiased estimate of X exists from observation of Y. Hint. Consider any x > 0 and compare with -x.
Deposit at the start of his studies to be able to withdraw : Pete Morton is planning to go to graduate school in a program of study that will take 2 years. Pete wants to have $19000available each year for various school and living expenses. If he earns 7 percent on his money, how much must be deposit at the st..
Create pipe-and-filter network that will read data stream : Create a pipe-and-filter network that will read the data stream in FlightData.dat file, convert the temperature measurements from Fahrenheit to Celsius, and convert altitude from feet to meters - How would this impact the key quality attributes of ..
Discuss the rationale that underlies management''s belief : Briefly discuss the rationale that underlies management's belief.
Inflation has relatively stable over last several decades : Inflation has been relatively stable over the last several decades, averaging roughly 2.85% per year. A local business owner began manufacturing snowshoes 6 years ago, at which time her raw materials cost $23.85 per pair. Taking into account the effe..
Database for the application : After creating the correct structure of the required tables, you need to perform the following tasks to create a database for the application: 1. Create a database for the application.
What is this projects equivalent annual cost : A five-year project has an initial fixed asset investment of $285,000, an initial NWC investment of $25,000, and an annual OCF of −$24,000. The fixed asset is fully depreciated over the life of the project and has no salvage value. If the required re..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a method that would search through an arraylist

What is the best way of the following ways (For each, Iterator, While with index) that you would use to create a method that would search through an ArrayList of files for a certain file and then delete it, and why?

  Implemented a distributed rental car management system

You implemented a distributed rental car management system using Java TCP Sockets and object streams. The goal of this project is to use code from your TCP project and create a new implementation of the rental car management system using Java RMI

  Develop a java program that simulates the queues in a bank

Develop a java program that simulates the queues in a bank. Implement the event-driven simulation of a bank. A queue of arrival events will represent the line of customers in the bank.

  Technical community blog

Write a blog article for a coding/technical community blog

  What is a nested inner class

What is a nested inner class? What special privileges does a nested inner class have? Give an example of how you declare a nested inner class

  Create a gui client side application that is a java version

q1. create a gui client side application that is a java version of notepad giving the ability to open modify and save

  Write and test a java program to read in multiple lines

A palindrome is defined as a string of 1 or more characters that contains a word, a phrase or a number that reads the same forward and backward, ignoring case, punctuation and white space.

  Your task in this assignment is to develop a graphical user

your task in this assignment is to develop a graphical user interface based java program that can communicate with a

  Implement the hierarchy for a university with java classes

Implement the above hierarchy for a university with Java classes and their appropriate relationship. You can go three levels deep in the hierarchy (community member, employee, student, alumnus, faculty, staff). Use your best judgment of instance v..

  Prepare a mobile android app

The app should target Android and be written in Java, unless you have obtained prior permission from your instructor to target a different platform

  The letters of the alphabet a through z

The letters of the alphabet A through Z can be represented in Morse code. Each letter is represented by a combination of up to four dots and/or dashes, as shown below. Use Java to write and run a console-window program that can convert an English ..

  Implement a sorting algorithm for inclusion in a package

Prepare a targeted plan in which you present your detailed strategies to recruit and select 20 Engineers to hire (full-time or part-time) within 8 months - Implement a sorting algorithm for inclusion in a package for a lucrative client.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd