3/26/2009

Exercise 9-3

9.3. Can you modify the scripts to process the form?

Yes, i can use the html form named ex9.html which is created in exercrise 9.1 for passing the data by the perl, python & javascript, and use them to print out info from ex9.html.

A. PERL

First, i create a perl file named ex93.pl with the following code:
























Secord, set the action attibute to "/cgi-bin/ex93.pl" in ex9.html, like this
( FORM METHOD="post" ACTION="/cgi-bin/ex93.pl")

Third, access ex9.html, input info in ex9.html and click submit button
























Third, check the result in ex93.pl













It works!!!!!!


B.PYTHON

First, create a python file named ex93.py with following code:













Second, set form method with post and hardcord the action location in ex93.html
FORM METHOD="post" ACTION="/cgi-bin/ex93.py"

Third, access ex9.html, input the information and click submit button.






















Fourth, check the result.























It works!!!!!!

C. Javascript

First, create a html file named ex93_java.html which is embedded the javascript is used for querying form data with following code.


















Second, set form action to [ form onSubmit="return false" ] in the ex9.html and add a form submittted button with following code

[ input onclick="window.location.href = 'ex93_java.html?' + 'first='+ this.form.first.value + '&' + 'last='+ this.form.last.value + '&' + 'paymethod='+ this.form.paymethod.value + '&' + 'cardno='+ this.form.cardno.value + '&' + 'cardexp='+ this.form.cardexp.value" type="button" value="Submit" ]

Third, access the ex9.html, input information and click submit button.























Fourth, check the result!

It works!!

Exercise 9-2

9.2. Write the script

Script archives exist for PERL, Python and JavaScript. Search the Web for a script that processes the HTML forms data. Read the code and list the steps involved in processing form.

A.) PERL (study how to use perl for performing form data from
http://www.howtodothings.com/computers/a1297-how-to-access-get--post-request-data-using-perl.html)

A1.) Create a html page named test.html with the following code:














A2.) Create a perl fiel name test_get.pl with the following code:



























Code Explanation:
Line 1: Locate the path of executable perl
Line 2: Inform internet browswer that the below info is a text in html format
Line 4 to 14: It is a function named populatePostFields
Line 5: hash named postFields
Line 6: how many bytes are we supposed to receive?
Line 7: make a list of key/value pairs
Line 8 to 13: cycle through each part and decipher the values
Line 9: get the name/value part strings
Line10: ??? s/%23/\#/g ???? i don't know
Line11: ??? s/%2F/\//g ???? i don't know
Line12: add the part to a list keyed on the name of the variable


A3. Real case Test - please see the below figure
Input some text in the text box and click submit button













It works!!!! The tutorial is from howtodothings that is workable!!

















B.) PYTHON (study PYTHON how to use CGI for performing form data from http://www.python.org/doc/essays/ppt/sd99east/sld041.htm)

B.1.) Create a html named test.hml with following code:














B.2.) Create a python file name test.py with following codes






















Code Explanation:

Line 1: Locate the path of executable perl
Line 3: Import CGI
Line 5-12: Define a function named main used for handling the parsed query info from test.html
Line 7 :Inform internet browswer that the below info is a text in html format
Line 8:Define a variable which is used to take care of decoding and handle POST by cgi.FieldStorage()
Line9-12: if-condition for identify the field named firstname whether is null and has_key only of firstname , if yes, print out "Hello, $firstname, You are handsome", else, print out "Error! Please enter first name"
Line13. execute the function namly main.
B3. Real case Test - please see the below figure

Input "Sam" in the first field and "Kwong" in the second field then click submit button.
















The below result shows the form data that can be successful passed from test.html to test.py

It works!!!! The tutorial is from python.org that is workable!!




























C.1.) Create a html file named testjava.html with the followind codes:


















C.2.) Create a html named jvscript_tst.html which is embedded the javascript in the html page with following code.




















Code Explanation:

Line5-29: Define a function named createRequestObject that is used to request the parsed query string from previous page of URL, simply create an array to store the data from previous url page and use while-loop for query all the data...
Line5: Define a function named createRequestObject();
Line6: Define an object name FORM_DATA which is an array using for store our data
Line7: Define a token that is used to separate data from multi-select inputs
Line8: Define a variable that stores the url info (this.location) and adding a null-string '' forces an implicit type cast from property to string, for NS2 compatibility.
Line10: Use variable named query to store the info after question mark of url
Line11: if-condition that returns false when query.length is smaller than 1
Line12: Defines an object named keypairs to store and keep track of name and value pairs
Line13: Defines a variable name numKP and set its' value to 1 which is a location flag of keypairs[]
Line14-17: Use a while-loop to query all the value between each "&" of URL, and store the result in the array name keypairs.
Line18: Define keypairs[numKP] is equal to query
Line19-24: Use a for-loop to get the URL's varible name and value from the keypairs array, also within the for-loop, there is a while-loop which is used to replace each '+' in data string with a space.
Line25: Set key value to unscape non-alphanumerics
Line26: Generate a separtor-delimited string by appending to what we already have stored
Line30: Set Form_DATA to createRequestObject, which is used to retrieve information with "FORM_DAT[key]=value"
Line34: set "onload" the web page and call the function named createRequestObject
Line36-38: Define varible to store the value which is getting from FORM_DATA[key] and use document.write to print out those value.

C3. Real case Test - please see the below figure
Fill in the my first name and last name in the text box and click button named "Go"







It Works!!!

Exercise 9-1

9.1. Design the form
"Retrofit" the form data string above for buying some French perfume into the HTML form fields and submit button on the Web page form.


a.) Please see the below screen dump, this is a webpage for user to input their payment infomation in order to complete transaction.






















b.) Please see the below screen dump, this is a core part of html source code of above screen dump.


3/25/2009

Exercise 11-3

11.3. SMIL is an application of XML. What is the purpose of this technology? Where does it apply?

SMIL is stand for Synchronized Multimedia Integration Language as a language for choreographing multimedia presentations where audio, video, text and graphics are combined in real-time.It applys for describing multimedia presentations and the followings describes SMIL’s utilization (W3schools, 2009):

a.) SMIL can be used to create Internet or Intranet presentations
b.) SMIL can be used to create slide-show presentations
c.) SMIL has been described as the Internet answer to PowerPoint
d.) SMIL presentations can display multiple file types (text, video, audio...)
e.) SMIL presentations can display multiple files at the same time
f.) SMIL presentations can display files from multiple web servers
g.) SMIL presentations can contain links to other SMIL presentations
h.) SMIL presentations can contain control buttons (stop, start, next, ...)
i.) SMIL has functions for defining sequences and duration of elements
j.) SMIL has functions for defining position and visibility of elements

References:
W3schools (2009). “SMIL Introduction” . Received 25th March, 2009 from URL -
http://www.w3schools.com/smil/smil_intro.asp

Exercise 11-2

11.2. What are the benefits of adopting a schema standardized for a business sector?

Standardized schema is really good for business development, for example, a kind of schema named “Electronic Business using eXtensible Markup Language” (EBXML) that enables the global use of electronic business information in an interoperable, secure, and consistent manner by all trading partners. Xmlone (2005) states that Gain insight into xbXML from a top-level perspective and why it is an important standard for companies to consider. Designed with business objectives in mind, the vision of ebXML is to create a single global electronic marketplace where enterprises of any size and in any geographical location can conduct business with each other through the exchange of XML based messages. ebXML is created for electronic interoperability, allowing businesses to find each other, agree to become trading partners and to conduct business. All these operations can be performed automatically, minimising human intervention. Streamlining electronic business also offers lower costs to open and standard mechanisms.

Jim Green, Chief Technology Officer, webMethods (w3, 2001) said that
exchanging business information was a critical requirement for automating business processes within and between companies. webMethods wad pleased to see XML Schema approved as a Recommendation, and to have been an active participation in the development of this standard. XML Schema made describing, exchanging, and validating business information easier and more flexible.


References:

W3 (2001). “Testimonials for XML Schema Recommendation” . Received 25th March, 2009 from URL -
http://www.w3.org/2001/05/xml-schema-testimonial

Xmlone (2005). “Program Synopsis.” . Received 25th March, 2009 from URL-
http://www.xmlone.org/xmlasia2005/programsynopsis.shtml

Exercise 11-1

11.1. Conduct research on the Internet to find out what tools can be to parse an XML document and ensure that the document is well formed and valid.

W3schools(2009) states that all modern browsers have a built-in XML parser that can be used to read and manipulate XML, and the tools are used to ensure that XML document is well formed and valid such as
W3schools’s XML Validator (
http://www.w3schools.com/xml/xml_validator.asp),
validome’s XML Validator (http://www.validome.org/xml/) and
PMC XML Validator (
http://www.pubmedcentral.nih.gov/utils/validate/xmlcheck.cgi)

References:

W3schools(2009). “XML Parser” . Received 25th March, 2009 from URL -
http://www.w3schools.com/xml/xml_parser.asp

3/24/2009

Exercise 10-3

10.3. What are the similarities between the object-oriented development using model-view-controller(MVC) in Ruby on Rails 2.0 and Action Script 2.0 (Flash animations)

Tutorialspoint(2008) states that the Model View Controller principle of Ruby on Rails MVC framework divides the work of an application into three separate but closely cooperative subsystems, which are Model (ActiveRecord ), View ( ActionView ) and Controller ( ActionController ). These three features are similar to actionscript 2.0.

Model (ActiveRecord ) of MVC
Maintains the relationship between Object and Database and handles validation, association, transactions, and more.
This subsystem is implemented in ActiveRecord library which provides an interface and binding between the tables in a relational database and the Ruby program code that manipulates database records. Ruby method names are automatically generated from the field names of database tables, and so on.

Actionscript 2.0 is as same as MVC Ruby that also can maintains the relationship between Object and Database, for example ActionScript 2.0 code to link the object from results to the dataProvider of the dataset, as shown in the following OO code;
myObject : Object = new Object();
myObject.result = function() : Void
{
my_ds.dataProvider = my_ws.results;
}
my_ws.addEventListener(“result”, employeeObject);


View ( ActionView ) of MVC
A presentation of data in a particular format, triggered by a controller's decision to present the data. They are script based templating systems like JSP, ASP, PHP and very easy to integrate with AJAX technology.
This subsystem is implemented in ActionView library which is an Embedded Ruby (ERb) based system for defining presentation templates for data presentation. Every Web connection to a Rails application results in the displaying of a view.

Actionscript 2.0 also have a templating feature, as shown in the following figure which is from
http://ntt.cc/wp-content/uploads/2009/01/clip-image001-thumb3.jpg

Controller ( ActionController ) of MVC:
The facility within the application that directs traffic, on the one hand querying the models for specific data, and on the other hand organizing that data (searching, sorting, massaging it) into a form that fits the needs of a given view.
This subsystem is implemented in ActionController which is a data broker sitting between ActiveRecord (the database interface) and ActionView (the presentation engine).

Adobepress (2009) states that ActionScript objects provide a means of moving graphic elements dynamically, building applications, organizing data, and more. You accomplish these tasks by using or setting object property values and invoking object methods.


Referances:

Tutorialspoint(2008). “Ruby on Rails Framework” . Received 24th March, 2009 from URL -
http://www.tutorialspoint.com/ruby-on-rails/rails-framework.htm


Adobepress (2009). “Introducing ActionScript Objects” . Received 24th March, 2009 from URL - http://www.adobepress.com/articles/article.asp?p=31465

Exercise 10-2

10.2. Why is the perception getting stronger that integration will become a critical factor in coming days? What is the role of AJAX within the enterprise software architecture?

Pauline Ratnasingam (2003) states that, in order achieve potential benefits of e-commerce, organization should follow characteristics of leaders that include being smaller and more focused on business benefits in e-commerce. Moreover, organizations should give e-commerce higher importance in their business strategies by having an aggressive cost focus and higher and more specific expectations from technology. Hence, organizations will be able to demonstrate higher levels of integration of e-commerce.


AJAX acts a loser within the enterprise software architecture.
According to a Backbase's research (Backbase, 2009). , it indicates that the top five problems hindering successful enterprise Ajax implementation are:



a.) Unsupported Ajax projects, widgets, and toolkits


There are many open source Ajax projects, but these solutions are fragmented and no software company is supporting them or committed to their future. These projects are developed differently, are incompatible with each other, and it’s a safe bet that the vast majority of them won’t exist two years from now. It’s very difficult to make a safe choice here. Even if a software company is backing the project, the level of commitment is very modest. They typically don’t provide business-grade support and training, and no guaranteed roadmap for ongoing development.


b.) Lack of established Ajax best practices

Because Ajax is a fairly new technology, few people know the proven best practices for Ajax development. Without best practices, businesses often face expensive trial-and-error exercises, unnecessary project delays, downstream code integrity and maintenance issues, and sometimes security threats. Getting it right can waste a lot of money and time.


c.) Poor integration of Ajax in the normal development lifecycle

Most Ajax tools available today are no more than loosely organized JavaScripts. They have no tools for rapid application development, accelerated testing and debugging, or integrating Ajax into existing application development processes and tools. Further, using these free tools proliferates “spaghetti code:” an unstructured hodgepodge of JavaScript code that makes application testing and maintenance a nightmare.


d.) Lack of reliable external support and trainingRisk of intellectual property violations
When technology isn’t supported by a commercial business, businesses need alternatives for training and supporting their development environment. Some consulting companies offer support on open source projects, but it’s not their core business and they typically deliver it as a “one-off.” Without the economies of scale, support services become expensive and unsustainable, leaving clients “high and dry.”



e.) Risk of intellectual property

Many open source Ajax projects include code from several sources on the Internet. These code snippets are licensed under different licenses with different terms of use. There is no guarantee that the code doesn’t violate patents. Developers are usually unaware of these risks; they simply use whatever code will speed up development. However, users of open source projects can be targets for patent infringement claims — especially as open source projects are hard to sue. Given these sizable problems, it's understandable that enterprises might hesitate to implement Ajax. However, with market momentum driving IT departments to deliver RIAs to customers and internal clients, avoidance isn't an answer. Enterprises need a reliable partner, whose core business is ongoing Ajax innovation, code maintenance and product support. That partner is Backbase. And the solution is Backbase Ajax 360.Backbase Ajax 360. Please refer to below figure which is from backbase. In the figure, we can find that Ajax 360 seem a complete enterprise solution.





References:

Pauline Ratnasingam (2003), Idea Group Inc (IGI), “Inter-organizational trust in business-to-business e-commerce”, pp.16-17.

Backbase (2009). “AJAX in enterprise whitepaper” . Received 24th March, 2009 from URL -
http://docs.backbase.com/docs/WP_Ajax_in_the_Enterprise.pdf

3/23/2009

Exercise 10-1

10.1. Go to the website of IBM, Oracle, Microsoft and Sybase. Is there any mention of e-commerce associated with their database product? What suite or partnership do they list with related e-commerce offerings? How do they compare with open source products like MySQL?

IBM(2009) states that there is an e-commerce associated with their database product named DB2 that can connect with a web server to create robust, high-volume e-commerce applications. DB2 Connect provides several solutions that improve web-based application performance. Stored procedures allow DB2 Connect users to reduce the number of queries being sent to the database, furthermore, IBM offers a program suite that is DB2(R) Universal Database that supports all the key Internet standards, making it an ideal database for use on the Web. It has in-memory speed to facilitate Internet searches and complex text matching combined with the scalability and availability characteristics of a relational database. Because DB2 Universal Database supports WebSphere(R), Java(TM) and XML Extender, it makes it easy for you to deploy your e-business applications. In additional, DB2 Universal Developer's Edition has several tools that provide Web enablement support. WebSphere Studio Application Developer, Version 4, is an integrated development environment (IDE) that enables you to build, test, and deploy Java applications to a WebSphere Application Server and DB2 Universal Database. WebSphere Studio is a suite of tools that brings all aspects of Web site development into a common interface. WebSphere Application Server Advanced Edition (single-server) provides a robust deployment environment for e-business applications. Its components let you build and deploy personalized, dynamic Web content quickly and easily.




IBM 's DB2 compares with mysql, in details, please refer IBM web site at http://www.ibm.com/developerworks/data/library/techarticle/dm-0602tham2/



a.) Container comparision between DB2 and MySQL
Depending on the table type being used, MySQL stores data in either single files, multiple files, or tablespaces.





In contrast to MySQL, DB2 Express stores everything in tablespaces. Tablespaces are logical representations of physical containers in filesystems, DB2 database structure is laid out in this fashion, with each layer in the hierarchy to represent the following that is better than MySQL.




b.) Availabilty comparision between DB2 and MySQL
MySQL supports user-defined functions, store procedure, views, updateable views, triggers and DB2 supports user-defined table, user-defined functions, user-defined data types, store procedure, views, updateable views, triggers, recursive SQL, squences. So DB2 is more powerful than MySQL.

Oracle(2009) states that there is an e-commerce associated with their database product , that is using “Oracle E-Business Suite On Demand” which offers business benefits that give you enhanced security and compliance as well as improved system scalability, performance, and availability. It also provides change management services, including product updates and upgrade processes that are engineered to give you access to the latest product innovations and capabilities. Oracle experts use Information Technology Infrastructure Library (ITIL)–based processes and automation to manage your software on proven configurations across the entire Oracle technology stack.
Oracle On Demand delivers the following core services designed specifically for Oracle E-Business Suite:
• Infrastructure management—Provides, manages, and maintains hardware, network
connections, and facilities for customers
• Software management—Uses a closed loop process with Oracle experts to solve
customer problems quickly, along with rootcause analysis to avoid problems altogether
• Security management—Manages the security tools, processes, and precautions
that protect the privacy and security of customer data and solutions
• Service level management—Provides a service-desk escalation process, meets service levels, and then measures and reports results directly through customer portals
• IT governance—Provides a service delivery manager to work closely with customers, resolve problems, plan and execute changes, and keep customer IT solutions aligned with the business.

There are many points of comparison between Oracle and mysql, in detail, please refer oracle web site at http://download.oracle.com/docs/cd/E12151_01/doc.150/e12155/oracle_mysql_compared.htm

a. Database Authentication Comparsion between Oracle and MySQL


MySQL is unlike Oracle (when set up to use database authentication) and most other databases that use only the user name and password to authenticate a user, MySQL uses an additional location parameter when authenticating a user. This location parameter is usually the host name, IP address, or a wildcard (Ò%Ó). With this additional parameter, MySQL may further restrict a user access to the database to a particular host or hosts in a domain. Moreover, this also allows a different password and set of privileges to be enforced for a user depending on the host from which the connection is made. Thus, user scott, who logs on from abc.com may or may not the same as user scott who logs on from xyz.com. It seems MySQL that is flexible but it’s not secure.

b. Privileges Comparsion between Oracle and MySQL
MySQL is unlike in Oracle, there is no concept of role in MySQL. Thus, in order to grant a group of users the same set of privileges, the privileges have to be granted to each user separately. Alternately, though less satisfactory for auditing, users performing tasks as a role may all share a single user account that is designated for the "role" and with the required privileges granted. So Oracle is easy to define the privileges by role than MySQL.

Microsoft (2009) states that there is an e-commerce associated with their database product named Microsoft® SQL Server™ that is a database management and analysis system for e-commerce, line-of-business, and data warehousing solutions. SQL Server 2008, the latest version, includes enhanced XML support, integration of .NET Framework objects in databases, improved integration with Microsoft Visual Studio and the Microsoft Office System, as well as improved analysis, reporting, and data integration services, that offers a comprehensive suits for e-commerce development. Refer to Microsoft official web site (http://www.microsoft.com/sqlserver/2008/en/us/compare-mysql.aspx#partner) that has an article titled “Compare SQL Server to MySQL”,
states that Microsoft SQL Server 2008 outperforms MySQL as a database platform in all business-critical areas. It provides a large resource network, industry-leading performance and enterprise-ready scalability, the highest level of security, the highest availability, a comprehensive Business Intelligence (BI) platform—all at a low total cost of ownership (TCO). Moreover,Microsoft SQL Server 2008 has fully compared with MySQL with the following points:

· Partner Ecosystem
· Scalability
· Security
· High Availability
· Business Intelligence
· Total Cost of Ownership (TCO)


Sybase (2003) states that there is an e-commerce associated with their database product named Sybase Communications e-Business Solution (CeBs) is a suite of e-Care and e-Commerce applications with a vertical focus in Communications. With Communications e-Business Solution, Communications Service Providers can tap the cost savings, personalization, and efficiency of Web-based self-service through simplified browser-based access to business support systems for customers, channel partners, and employees. However, Sybase Communications e-Business Solution (CeBs) is no longer offered by Sybase.

Sybase does a performance Comparison between their product named ASE 15 and MySQL 5.0, and it states that Adaptive Server® Enterprise (ASE) is a highly scalable, mission critical database server that provides a portable, multi-platform system for high performance data management. The new features of ASE 15.0 deliver an operational advantage with lower cost and risk, and they achieve higher performance on mixed workload systems. Testing with ASE 15.0 has shown an advantage in overall performance for transaction processing over MySQL 5.0, and many complex queries show significant improvements. For more details, please refer to Sybase official article at http://www.sybase.com/detail?id=1045499


References:

IBM (2009). “DB2 Connect and web applications”. Received 24th March, 2009 from URL - http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/wareh/getsta06im.htm

ORACLE (2008). “Improve Your Business Performance with Oracle E-Business Suite On Demand” . Received 24th March, 2009 from URL - http://www.oracle.com/ondemand/collateral/oracle-e-business-suite-on-demand-brief.pdf

Microsoft (2009). “Microsoft SQL Server” . Received 24th March, 2009 from URL -
http://technet.microsoft.com/en-us/library/bb545450.aspx

Sybase(2003), “Communications e-Business Solution”. Received 24th March, 2009 from URL -
http://www.sybase.com/products/archivedproducts/communicationse-businesssolution









Exercise 8


8.1. Start with a simple table in the database:
mysql > select * from employees;
a.) create a table named employees as the below screendumps.

b.) Insert a record to the emloyees tables and select the data from it as the below screendump:
8.2. Create a web page with the following php:


When we execute ex82.php, the output is showed as follows:

8.3. This is how we can add a record and is part of a file to create called add_record.html

a.) Create a html file name add_record.html, please see below screendump.

b.) Input something in the textbox and click button named "Enter information".
c.) Check that new data can be found in employees table, please see the following screendump;

8.4. The corresponding PHP file is add_record.php used with the POST method:
a.) Create a html file named add_record.html with POST method.

b.) Create a php file named add_record.php in order to receive the variables of add_record.html with POST method.


8.5. The last code example shows how to get multiple records:
a.) create a php file named ex85.php


b.) Success to get multiple records, please see the following screendump.





Exercise 7

7.1 Create an HTML page with the form:
The output is showd as follows:


7.2 Then, create a PHP file named submit.php with the following code:

The output is showd as follows:



Exercise 6

6.1. In this exercise with can call up and examine some environment variables on the server. The code below has the unix environment variable for storing your remote Internet address. UNIX environment variable are recognised by the use of upper case letters. Try the same code by replacing with $ REMOTE_ADDR $SERVER_NAME, or $PHP_SELF

The below screendump shows some php code which is replaced by $REMOTE_ADDR.


The below screendump shows some php code which is replaced by $SERVER_NAME.


The below screendump shows some php code which is replaced by $PHP_SELF.





6.2. Create a web application called "hello_world.php" which contains in the body:

"$myvar = "Hello World!"; echo $myvar;?>
The result is showed in the following:









Exercise 5-3

5-3. Framework for development. Compare and contrast any Two of:

a. Java

b. .NET

c. Ruby on Rails

d. Turbo Gears

e. Google Gears

f. AJAX frameworks.

I would like to compare and contrast the framework between Java and .NET based on c-charpcorner (2001).

I.) Object-oriented approach - Both of them use an object-oriented approach for design.

II.) CLR vs JVM - The .NET framework's Common Language Runtime (CLR) is much similar to Java Virtual Machine (JVM), in terms of garbage collection, security, just in time compilation (JIT).

One of the fundamental differences between Java Virtual Machine (JVM) instruction sets and Common Intermediate Language (CIL) is that JVM is big endian ( most significant byte first) and CIL uses little endian ( least significant byte first) binary representation. This difference will not be apparent to most of the programmers. Only system level programmers would have to deal with it.

III.) Multiple platform vs multiple languages - Java platform views the Internet world as one language running on different operating systems (OS), whereas .NET framework views the world running on one OS with a programmers having choice of multiple languages. Therefore Java platform interpolates multiple operating systems, and .NET framework interpolates multiple languages.

IV.) Assemblies - An assembly is the functional unit of sharing and reuse in the Common Language Runtime. It is the equivalent of JAR (Java Archive) files of Java. The Microsoft documentation stress that assemblies are "logical dlls". This may be a reasonable paradigm for VB or C++ programmers, but Java programmers will find it easier, if we visualize assemblies as an extension of JAR concept. However, unlike JAR, each assembly can have only one entry point defined, which can be either DllMain, WinMain, or Main.

V.) Conclusion - .NET is definitely an improvement over Java framework, but it is NOT going to displace Java any time soon. Though in coming years Java and .NET will converge.
It currently lacks support for other platforms. Since .NET has been architected by Microsoft, it is less likely to find the open source support base of free thinking programmers, which was one of the main reasons of Java's popularity.



References:
c-charpcorner (2001). “.Net framework comparsion with Java Architecture”. Received 20th March, 2009 from URL -
http://www.c-sharpcorner.com/UploadFile/abanerjee/DotNetforJava11292005023419AM/DotNetforJava.aspx

3/22/2009

Exercise 5-2

5.2. Describe the important and distinguishing properties of Peer to Peer computing and the Grid. How is this peer to peer and the Grid architecture changing work flow and service-oriented applications?

Peer to Peer computing is important for distributed computing, data/content sharing, communication and collaboration, or platform services.

HP(2003) states that the term “peer-to-peer” refers to a class of systems and applications that employ distributed resources to perform a function in a decentralized manner. The resources encompass computing power, data (storage and content), network bandwidth, and presence (computers, human, and other resources). The critical function can be distributed computing, data/content sharing, communication and collaboration, or platform services.
Furthermore, peer-to-peer(P2P) enables valuable externalities, by aggregating resources through low-cost interoperability, the whole is made greater than the sum of its parts escalator, it also lowers cost of ownership and cost sharing, by using existing infrastructure and by eliminating or distributing the maintenance cost, moreover, it enables anonymity/privacy, by incorporating these requirements in the design and algorithms of P2P systems and applications, and by allowing peers a greater degree of autonomous control over their data and resources

Grid computong is important for support various business processes.


HP(2009) states resources can be dynamically provisioned to users or applications that need them in grid computing. Resources can be shared within a workgroup, department or enterprise; among different organizations and geographies; and even with groups outside the enterprise in collaborative projects. Grids can be designed to support various business processes. Grid technologies use emerging Web services standards such as XML, SOAP and WSDL and have long been used for scientific and technical work, where dispersed computers are linked to create virtual supercomputers that rapidly process vast amounts of information.


Domenico Talia (2003) states that Grid and P2P can be distinguished by the following points:

First, Security is a central theme in grids, and several efforts are devoted to integrating relevant mechanisms for authentication, authorization, integrity, and confidentiality in grid platforms. In contrast, P2P systems originate in "open communities," in which users share more generic goals such as retrieving music from the Internet, rather than specific objectives such as participating in high-energy physics simulations.

Second, Connectivity, Grids generally include powerful machines that are statically connected through high-performance networks with high levels of availability. On the other hand, the number of accessible nodes is generally low because access to grid resources is bonded to rigorous accounting mechanisms. Conversely, P2P systems are composed mainly of common desktop computers that are connected intermittently to the network, remaining available for a limited time with reduced reliability. The number of nodes connected in a P2P network at a given time is much greater than in a grid. Thus, the grid connectivity approach is still too stiff for new nodes and user access and accounting; it could benefit from the more flexible connectivity models used in P2P networks today.

Third, Fault Tolerance, the dynamic nature of grids necessitates some level of fault tolerance—especially for highly distributed code, such as parameter-sweep applications, which can fork numerous similar, independent jobs on many nodes.
Beyond simple checkpointing and restarting, reliability and fault tolerance are largely unexplored in grid models and tools. The Globus information system allows fault detection, for instance, but developers must implement fault tolerance at the application level. For greater reliability, designers of fault-tolerance mechanisms and policies for grids should consider using decentralized P2P algorithms, which avoid centralized services that can represent critical failure points.




Peer to peer is changing the work flow and service-oriented applications, firstly i want to describe how is traditional work flow and service-oriented application, please see the below figure:




The traditional work flow and service-oriented application are one-to-many, that's one server serves many clients, for example, one FTP server can allow many ftp client to download / upload online files.

Conversely, P2P's work flow and service-oriented application are many-to-many, please refer to the below figure, you can find that all nodes are multi-connected between each others, this design allows for scalable incremental growth and aggregates tremendous amount of computation and storage resources, for example, internet users cooperate to share such as music files
Napster, Gnutella, Morpheus and KaZaA; online communication application such as Skype and free Internet IP telephony.



And Grid architecture is changing the work flow and service-oriented applications, it is because...
a.) need for people-services as well as middleware services(computer services), for example, credential authorities, VO managers, support.

b.) Single sign-on to resources in multiple organisations.

c.) Flexible collaboration across multiple administrative domains for example sharing data, computers, instruments, application software

d.) It is a virtual organisation covered people and resources collaborating for example across admin and organisational boundaries.


References:

HP(2003). “Peer to Peer Computing”. Received 20th March, 2009 from URL -
http://www.hpl.hp.com/techreports/2002/HPL-2002-57R1.pdf

HP(2009). “What is grid computing?”. Received 20th March, 2009 from URL -
http://h71028.www7.hp.com/enterprise/cache/125371-0-0-0-121.html


Domenico Talia (2003), Paolo Trunfio, "Toward a Synergy Between P2P and Grids," IEEE Internet Computing, vol. 7, no. 4, pp. 96, 94-95.



Exercise 5-1

5-1. Investigate a simple chat client/Server system. Look at some program code and describe how it works with multiple uses.

A simple chat clent/server uses TCP/IP sockets to communicate between chat clients and chat server. In the chat client's side, users can send and view messages from server, correspondingly, in the chat server's side, it continuously listens for incoming messages from chat clients, integrates all messages and send it back to all chat clients.

I will show you some program code that is found from javaworld(2009) as follows:

a.) Classes on Chat server
In the chat server side, there are two classes, they are main class, ChatServer, is a server that accepts connections from clients and assigns them to new connection handler objects. The ChatHandler class actually does the work of listening for messages and broadcasting them to all connected clients. On thread (the main thread) handles new connections, and there is a thread (the ChatHandler class) for each client.
Every new ChatClient will connect to the ChatServer; this ChatServer will handle the connection to a new instance of ChatHandler class that will receive messages from the new client. Within the ChatHandler class, a list of the current handlers is maintained; the broadcast() method uses the list to transmit a message to all connected ChatClients. See below program code:


public class ChatServer {
public ChatServer (in port) throws IOException
{
ServerSocket server = new ServerSocker (port);
While (true) { //continuously listen for chatclient by while-loop
Socket client = server.accept();
System.out.println (“Accepted from” + clien.getInetAddress ());
ChatHandler c= new ChatHandler (client);
c.start ();}
}
public start void man (String args[]) throws IOException
{
if (arg.length !=1)
throw new RuntimeException (“Syntax: ChatServer ”);
new ChatServer (Integer.parseInt (args[0]));
}
}

For more information, please see the below figure for understanding how the class work.
1.) All ChatClient use their core function name main() to connected to ChatServer via TCP/IP socket.
2.) Each ChatClient is handled by dedicated ChatHander which is located in Chat server side.
3.) All ChatClient use the function named run() to send the message to ChatHandler.
4.) After receiving any message from ChatClient, the ChatHanlder will use the function named broadcast() in order to broadcast all received message back to all ChatClient


The figure is received from javaworld(2009)

References:

JavaWorld (2009). “Multithreaded client/sever Chat”. Received 20th March, 2009 from URL - http://www.javaworld.com/javaworld/jw-01-1997/jw-01-chat.html?page=4

Exercise 4-4

4.4.) What role can a VPN play in business-to-business e-commerce?

More and more business is being conducted using the Internet. Electronic commerce is not only a major new method of retailing merchandise (called "B2C" for business-to-consumer e-commerce), but it is also a way for businesses to trade goods and services among themselves (called "B2B" for business-to-business e-commerce). Interconnectivity of businesses is essential, and the Internet is the logical choice for the interconnection technology.
E-commerce must be secure. Private networks use physical separation for security, but it is impractical to have a separate infrastructure for each customer or B2B partner. Therefore, a closed, inflexible private network is not well suited for supporting e-commerce. A public infrastructure is more flexible but lacks security.
VPNs provide both interconnectivity and security.