Thursday, February 22, 2007

Assignment #6

As last week was the first time I ever came in contact with Perl, I didn't understand this assignment. I spent far too long searching the Internet looking for help, only to come up with a half working Part 1. In turn I don't have anything for part two or three. Something isn't clicking for me yet, hopefully I will catch on soon.

Part 1 (Working, but incomplete code)

# 6.pl
# Reads characters


print "What file?";
$a = <STDIN>
chop $a;

#opens file
open (FILE, "$a") or die "File Missing. Find It!!";


while ($record =
<FILE>) {
print "This file has ", length($record), " characters!";

#makes each printed line on a seperate line
print "$record[-10]\n";

}

close(FILE);

Thursday, February 15, 2007

Assignment #5

Middleware and Service Oriented Architecture

In today’s fast paced computer world, we as computer users expect everything to work every time we use it. This means that programs that should work together, which allows us to get the most out of our programs, systems, and networks. Linda Rosencrance of Computerworld.com says this about middleware, “Middleware, software that functions as a translation layer, sits between an application residing on one server and any number of clients that want access to that application. In short, middleware allows users to interact with one another and with applications in a heterogeneous computing environment.” This is a very important feature that computers use, a feature that we as users never see.

This “cyberinfrastructure” as Educause likes to refer to it as, is the backbone of every system. The need for such software is not coming to a close any time soon either. More and more different systems are being implemented every day, and each of those will have the need to communicate with other systems on a daily basis. Whether companies will be able to use existing middleware or have to create their own is up in the air though. As Service Oriented Architectures become larger and faster each day, middleware is going to have to keep up with the pace. People expect their computers to react instantly, and if they don’t they will move on to another piece of hardware/software.

A very important feature of middleware is that it helps connect old legacy systems to new, updated systems. This way, companies do not have to lose out on millions of dollars every time a computer needs to be updated. This also aids in connecting different parts of a company together to flawlessly act as a whole. A company must understand its system before using some middleware. Some middleware will be packaged within a new system if it is a well known item. If the company has designed its own system, the new middleware might also have to be designed from the beginning. Luckily, each company has different types of middleware to choose from so it will fit their needs perfectly.

Some of the different types of middleware are database middleware, message-oriented middleware, transaction-processing monitors and Web middleware. An example of database middleware is any middleware that connects an application to a database, or a database to another database. Accessing an Oracle database using a transaction application would be one way to use this particular type of middleware. Message-oriented middleware according to the SEI is middleware that “increases the interoperability, portability, and flexibility of an application by allowing the application to be distributed over multiple heterogeneous platforms”. What makes this middleware useful is that messages sent over a network are stored if the receiver is not currently on the network. The sender however can send as many messages as it wants to though. Transaction-processing monitors allow a client/server to properly run and operate transaction applications. This middleware can work with many different clients which all need to talk to the server. It organizes the data into processing routines which is then routed to different services. Web middleware connects different data and applications to the Internet, where our different browsers can access them. Without web middleware we would not be able to work or play the way we do now. While there might be another way to connect ourselves to the vast amounts of information that is available, it might not be as easily done.

Martin Treiber and Schahram Dustdar of the Vienna University of Technology have the following to say about SOA and middlware:

“It can be seen that middleware and SOA have some overlapping goals, both aim at

• integration of distributed software systems

• support of heterogeneity concerning implementation

• support of different (distributed) architectures

Nevertheless, SOA and middleware take different approaches, since

• Middleware operates on a more concrete level (e. g. message passing, message

queuing, etc.)

• SOA provides ‘only’ a conceptual model”

This being said, it is easy to see the link between middleware and Service Oriented Architecture as at times, they are both trying to accomplish the same tasks. Integration with other software and the support of different architectures are essential to our daily computing. How else would a Mac user and a Windows user be able to communicate with one another? This world would surely be divided if this middleware didn’t exist.

One question that can be asked is, “Is middleware reliable?”. The answer to that varies from company to company, but Ebay would not be in business without it. Ebay uses middleware to enable its users to pay using PayPal. This is a very big deal for Ebay, so in turn middleware is very reliable, and very necessary to them. Vice President of systems design James Barrese says, "The integration tier is the keystone in this solution. This allows us to efficiently scale and manage our back-end resources." as well as, "Our abstraction layers make it easier to train new engineers, constantly improve the availability of the site and make live data architecture changes with no code changes and no downtime”. Oracle also seems happy with middleware as they announced their new concept of SOA 2.0 called Event Driven Architecture would include middleware that allowed their customers to react with data in real time. This goes back to people wanting information instantly, and companies are realizing that this is quickly becoming a reality.

Middleware seems like the perfect compliment to any Service Oriented Architecture that needed to expand and increase profits. Currently, and in the past, middleware has acted as the “glue” that holds the entire computer world together. As the years pass, improvements to middleware will be designed, and new ideas for completely different ways to connect different systems will become available. Until then, we use what we have and try to enjoy every minute of it. It worked for Ebay and Oracle, it could work for you too.


http://www.computerworld.com/softwaretopics/software/appdev/story/0,10801,52066,00.html

http://www.infosys.tuwien.ac.at/staff/treiber/Overview.pdf

http://www.educause.edu/ir/library/pdf/erm0241.pdf

http://blogs.zdnet.com/service-oriented/?p=675

http://www.infoworld.com/article/06/06/19/79432_HNoracleda_1.html

http://www.sei.cmu.edu/str/descriptions/momt.html

http://www.sei.cmu.edu/str/descriptions/tpmt.html

http://www.gcn.com/state/vol6_no6/guide/748-1.html

Wednesday, February 7, 2007

Assignment #4

CGI (Common Gateway Interface)

CGI is a very widely used standard for running external programs on a HTTP server. Like anything that is implemented on a computer, there are going to be problems and solutions to those problems everywhere. The following is a list stating some of these problems and solutions.

Coding a script wrong is probably one of the most common mistakes. If a CGI script doesn’t perform the way you expect it or you get an error message when executing it, then there is a problem somewhere. Another problem might be locating the error in your code. It could be that the script settings are incorrect, or your permissions are wrong. Make sure you double and triple check your code to make sure it will execute flawlessly. Another problem is that some scripts are too long, creating different problems. Testing and debugging is directly related to the size of the script. If the script size is manageable, then all related maintenance will also be manageable.

According to Webopedia, every time a new CGI script is run, it in turn starts a new process. This is bad news for slower older servers or high traffic servers. This will severely decrease the performance of your server. One solution to this problem is to use the server’s API (Application Program Interface). Using this aspect of the server will greatly increase the productivity since the applications are more integrated with the server. This also leads to a very large lag time between the server and the external program which can be somewhat fixed by keeping the CGI script in memory. This will only decrease the lag time, not eliminate it completely. Another time saving solution is to use cookies. Cookies will eliminate the unnecessary validations that must take place each time a page is accessed. Other problems include the fact that CGI scripts are stateless, meaning they exit as soon as their task is completed. Having to reconnect every time adds a considerable amount of time and has a large impact on performance. Scalability is also a problem when it comes to CGI since some systems can not handle a large number of processes started by each script.

There are ways to help ease the pain of these problems. One way is to use special CGI tools. A particular tool called CGI Tester will measure the performance of the scripts, along with statistics, error reporting, and server speed. Such tools will aid you in making your machine run at its best possible speed. Another solution that will help ease the pain of the server is to make the client-side do some of the work. JavaScript can be used to allow the browser to do some of the work, and also can be used for validation. You can also use the web server to keep the CGI scripts running all the time as co-processes. This way, when a script is called it will easily be able to complete its task without the lengthy start up time. This however puts a strain on the server’s memory, and utilities should be used to help reduce the stress on the machine.

Security is also a problem that must be addressed when using CGI. CGI is used to process user input, and this can be a very helpful addition to any website. However, users can trick CGI scripts into performing a command on the server which could result in a breach of your system. This can be remedied by using servlets. These servlets are used because they are not at risk of running forced, unintended commands. This will help prevent hackers from making their way into your system.

If you are going to use CGI scripts, you must understand how they work, and understand the risks that are involved. I believe CGI scripts are a good addition to an SOA, if they are used properly and are understood. Also, no script should be bigger than it has to be. The scripts should be kept to a smaller size to help in all aspects of coding and debugging. If there is extra code all over the place, it will appear messy, and it will surely show up when a customer tries to use your scripts. They could become unhappy with your service and you could lose them forever, just because you had too much going on at once. You must also make sure your server can handle the activities you want it to perform. If your site is heavily trafficked, you must have a server that will not collapse under all of the stress of running CGI scripts.


References

http://www.webopedia.com/TERM/C/CGI.html

http://www.k5n.us/article.php?id=0001


http://www.irt.org/articles/js172/index.htm#cgi_optimization