Friday, April 16, 2010

Exercise 6

1. Design The form

2. Write the script
2.1 Python
Step 1: Create a following html file with name html_python.html

Step 2:Create a python file name python.py (match with the name in html form)

Line 1: Specify the location of python.exe
Line 2: Import cgi
Line 4: Define main()
Line 5: Inform the browsers that the information is the text
Line 6: Declare a variable
Line 7-10: If condition to identify whether form "firstname" is null or not. If not null the information will be display, otherwise, the error will display.
Step 3:Press submit button and it is a result

3. Can you modify the script to process the form
Python
Step 1: Create a python file name python_mod.py with the following code

Step 2: Modify html file with this code :form method="post" action="/cgi-bin/python_mod.py"
Step 3: Input the information and press submit. This is the result

4. Improve the user experience by add a Javascript feature
Use JavaScript to confirm you want to submit it or not by code: input type="submit" value="Submit" onclick="return confirm('Are you sure you want to submit?')"

and To validate the field. For example, the field name can not be null.

By insert this code:
function validateName()
{
var str=form1.name.value;
if(str.length==0)
{
alert("The name cannot be empty");
return false;
}
return true;
}
and modify this code in the form1: input name="name" type="text" onBlur="validateName()"

Exercise 8

Create an XML document for an online catalogue of cars where each car has the child elements of make, model, year, colour, engine, number_of_doors, transmission_type and accessories. The engine has child elements called number_of_cylinders and fuel_system.

Thursday, April 15, 2010

Step 8 - Answer the question

a. What is git? Why it is useful?
According to Git site (n.d), Git is a free and open source, distributed version control system to handle everything from small to very large projects with speed and efficiency.

Every Git clone is a full-fledge repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Especially. (Git, n.d)

As Awebb (2009) stated that, Git is very useful because it shows significant benefits in development process such as
- It develops software collaboratively better while minimizing the influence of code conflicts
- Easy to track
- Branching and merging are fast and easy to do (Git, n.d)
- It is easy to turn any directory tree into a Git repository

References
Awebb (2009). Presentation on managing Drupal projects with Git and GitHub. Retrieved from http://groups.drupal.org/node/27834
Git (n.d). Retrieved from http://git-scm.com/

b. Describe how Sinatra relates to Ruby on Rails
According to wikipedia (2010), Sinatra is a free and open source web application framework and Domain Specific Language (DSL) for quickly creating web-applications in Ruby.It is an alternative to other Ruby web application frameworks such as Ruby on Rails.

Unlike Ruby on Rails, Sinatra does not follow a Model-View-Control (MVC) to create websites. Instead, Sinatra focuses on “quickly creating web-application in Ruby with minimal effort”. (wikipedia, 2010).

As Ron (2007) stated that Rails requires a separates routes file to define how the web application response to request, while Sinatra will automatically add the route, and simply start responding to request just by declaring a new “get” or “post” action

Reference

Ron, E. (2007). Sinatra, a Ruby web framework, and Why it Matters. Retrieved from http://deadprogrammersociety.blogspot.com/2007/10/sinatra-ruby-web-framework-and-why-it.html
Wikipedia (2010). Sinatra (Software). Retrieved from http://en.wikipedia.org/wiki/Sinatra_%28software%29#cite_note-0

c. What is heroku? What is a Heroku “Dyno”? Describe how Heroku makes deployment and scaling of Ruby web applications easy.


According to Heroku site, “Heroku is a cloud application platform for Ruby – a new way of building and deploying web apps”. Deploy any ruby app instantly with a simple and familiar git push. It has many benefits from taking advanced features like HTTP caching, memcached, rack, middleware, and instant scaling built into every app. Never think about hosting or server (Heroku, n.d).

Also flowing to Heroku site, Heroku “Dyno” is roughlt equivalent to an individual Mongrel, Thin, or FastCGI backend in traditional Ruby deployment environments.

Heroku can deploy and scale easily on Ruby because some features below (Heroku, n.d):
- Multi-Tenant: Heroku is a multi-tenant platform and hosting environment
- Fully Managed: Heroku can control all the infrastructure and software layers
- Curation: actively curate each layer
- Everything you need: provide everything needed to run a modern, high-performance, scalable web app.

References

Heroku (n.d). Introduction to Heroku. Retrieved from http://docs.heroku.com/heroku
Heroku (n.d). Dynos. Retrieved from http://docs.heroku.com/dynos

d. Inspect the Hello World application “app.rb” file. Answer these questions:
a. What is the purpose of the “/param/:name method”
That method to get the parameter from “/” and shows the message “Hello World”
b. What happens when the user navigates to the /home page?
The page almost does not change because it will be redirected to itself
c. What is the purpose of the :set directive
It is used to specify a location of file. Static files are served from the ./public directory.

Step 7 - Introduce change

Step 7 Introduce change
Change the message "Hello world" to "Welcome to Heroku" by using Vi command
After that do these following commands again
- git init
- git add .
- git commit -m "Change the message"
- git push heroku master

Step 7 - Introduce change

Step 7 Introduce change
Change the message "Hello world" to "Welcome to Heroku" by using Vi command
After that do these following commands again
- git init
- git add .
- git commit -m "Change the message"
- git push heroku master

Step 6 - Deployment Confirmation

Step 6: Deployment Confirm
- Heroku open and then navigate to Heroku web address. That is http://blooming-beach-29.heroku.com/

Wednesday, April 14, 2010

Elevator Pitch 1

Hello everybody,

We have created the blog to present our assignment about business to business system. After we have done all the exercises and workshops in assignment 1, we now have some concept about the e-commerce, distributed applications, client/server, database server, web application server, and ruby. That is very good for us to develop a professional website. Indeed, now we know how to develop a basic dynamic website by using php languages as well as the concept of 3-ties database model and other things are very useful.

Especially, after done the workshop about Ruby, we could understand what Ruby is, what Sinatra is, how does it works and how to deploy it on Heroku. We realized Ruby is a very good for rapid software application development

That's all. We hope that we will get more knowledge as well as aware of issues and procedures in assignment 2 in order to be able to develop a online business system.

Thank you

Elevator Pitch 1 Recording - Download

Step 5 - Deployment on Heroku

Step 4: Run Hello World
After installed Ruby, Sinatra and Git, We can run Hello World in localhost by the command "ruby app.rb", after that used a browser and navigate to http://localhost:4567/


Step 5: Deployment on Heroku
There are many steps to do at this step.
First: Create the Heroku account and then install heoku by "gem install heroku" and then publish the key on heroku by "heroku keys:add"
Second: Publish your application on Heroku with these following commands below:
1. Track your application with Git
- git init
- git add .
- git commit -m "New app"
2. Create you application on Heroku
- Heroku create
- Enter your username and password
3. Push your application on Heroku
- git push heroku master

Exercise 5

Case B: PHP and MySQL
1. The result from $REMOTE_ADDR


The result from $SERVER_NAME


The result from $PHP_SELF


2.Web Application called "hello_world.php"


3. An HTML page with form


4. A PHP file named submit.php


5.a Create a web page with the following PHP: That is a single view page.


b. The add_record.html page


c. The add_record.php page


d. The page show multiple records

Tuesday, April 13, 2010

Exercise 7

1. Why is the perception getting stronger that integration will become a critical factor in coming days?
In the recent days, e-commerce is more and more popular than ever, and it will be become a very important field in all over the world in the near future. Because of each customer at different places have different type of software, hardware, application and OS, so any company run online business have to try to integrate the architecture. According to Beth & William (2005), the following benefits will be brought when the organization can integrate system:
- Increasing the efficiency, effective, and competitiveness in business
- Improving the satisfaction of customer
- Improving IT operational effectively
- Increasing reuse existing applications.

References
Beth Gold-Bernstein, & William A. Ruh. (2005). Enterprise integration: the essential guide to integration solutions. Addison-Wesley

2. What is the relationship of AJAX to JQuery (jquery.com) and the lightweight Web 2.0 javascript framework called MooTool (mootools.net) within the enterprise software architecture.

As JQuery said in its website, “jQuery is a fast and concise JavaScript that simplifies HTML document travesing, event handling, animation, and Ajax interactions for rapid Web development. jQuery is designed to change the way that you write JavaScript”
while
In MooTools site, that is “MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.” That is the summary of jQuery and MooTools. We can see that any of each have particular feature like:

jQuery talks about HTML, events, animations, Ajax, and web development, while motools mentions about object-oriented-ness and writing powerful and flexible code (jqueryvsmootools, 2009).
One more things at this site jqueryvsmootools, Mootools is a framework that attemps to implement JavaScript and jQuery is a toolkit that is easy to use collection of methods in a self-contained system designed to make the DOM more pleasant.

References
jQuery (2010). Retrieved from http://jQuery.com
jQuery vs Mootools (2010). Retrieved from http://jqueryvsmootools.com/
MooTools.net (2010). Retrieved from http://Mootools.net

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)?
There are some similarities features between Ruby on Rails 2.0 and Action Script 2.0 in using MVC. In the basic principle, MVC is the separation of responsibilities. The model concerns about the application’s state and logic. By contrast, the view manages about the presentation of data. Finally controller take responsibility in translating user input into a suitable form in given view. The following details will describe some common feature of Ruby on Rails and Action Script
Model:
According to tutorialspoint (2008), in ruby on rails, the model class maintains the relationship between Object and Database and handles validation, association, transactions, and more

As Colin (2009) said that the model class of Action Scrips stores data in properties and provides application-specific methods that set and retrieve data

View
Data in Ruby on Rails is presented in a particular format, triggered by a controllers’ decision to present the data (tutorialspoint, 2008)

According to Colin (2009), the view in Action Scripts listens for state change in the model; the view updates the interface to reflect the change when the model changes

Controller
In Ruby on Rails, the main responsible of this class is directs traffic. On the one hand, it queries the models for specific data, and on the other hand organizes that data into a form (tutorialspoint, 2008)

In Actions Scripts, the controller listens for notifications from the views based on user input and translate into changes the the model (Colin, 2009)

References

Colin, M. (2009). Essential ActionScript 2.0. Retrieved from http://www.adobe.com/devnet/flash/articles/mv_controller.html
Turorialspoint (2008). Ruby on Rails Framework. Retrieved from http://www.tutorialspoint.com/ruby-on-rails/rails-framework.htm

4. What does it mean to develop RESTful practices into our web applications?
REST stands for Representational State Transfer (REST) is a style of architecture based on a set of principles that describe how networked resources are defined and addressed (Barry, n.d). REST has proved to be a popular choice for implementing Web Services. REST constraints is often referred to as RESTful.
An application or architecture considered RESTful has the following features:
- State and functionality are divided into distributed resources
- Every resource is uniquely addressable using a uniform and minimal set of commands
- The protocol is client/server, stateless, layered, and supports caching.

References

Barry, D.K. (n.d). Representational State Transfer (REST). Retrieved from http://www.service-architecture.com/web-services/articles/representational_state_transfer_rest.html

Exercise 1

1. Visit http://yahoo.com and http://facebook.com as examples of online communities

a. What is mean by an online community and how is it important for ecommerce?

The online community is also known with the name “social network site” is a virtual community that exists on the internet and whose members enable its existence through joining in membership rituals. The online community is a form of an information system that everyone in over the world can post any of content under the management of administrator. (Wikipedia, 2010). In addition, today online communities have become a supplemental type of communication, every member can communicate through many form such as voice, chat, blogs, video conference, forum that they can share each other any ideas, picture, movie, or something else. These are some advantages that assist enormously for e-commerce. Community will keep the customer coming back to the website that they access again. Moreover, that customer can also introduce their friends visit that website, as a result, the number of customers will increase possessively.

b. Is there a common thread and a local community sense in action?

The answer is yes. These are listed below:

- Select and search by categories

- Registration, profile management, shopping online, auction.

- Some website can detect the living region of visitors

- News, Forum or Group belong to local community.

Reference


Wikipedia (2010). Online Community. Retrieved from http://en.wikipedia.org/wiki/Online_community

2. Visit the famous online store front at http://www.amazon.com

a. Why has it been a successful site? How does the purchase of a book work?

Today, we all know Amazon is one of the largest websites selling the books; it achieves the top ranks in a very short time. To succeed like this, Amazon website often offer the following:

- A decent price.

- Almost available anything people wish.

- They have extra information for a large number of books like reader’s comments.

- International sale is also one of the successful reasons.

- Convenience: customers go online instead of go to the store and certainly, customer can buy the book they want.

- Good quality and reliability in products

According to Amazon.com (2010), claims that to purchase of a book at Amazon is quite easy. The customers do not need to create their account first. It will be created automatically when people place the first order online. These are the steps to place an order:

1. Find the products you wish

2. Add the products to Shopping Cart

3. Proceed to Checkout

4. Sign in or Create a New Account

5. Enter a Shipping Address

6. Select a Shipping Method

7. Provide payment information

8. Review and submit

9. Check Your Order Status.

b. Are there any secure transactions not involving money.

Yes, they use Secure Socket Layer (SSL) to encrypt confidential information between user browser and Amazon web server in customer self-service tools during transactions. Some self-services are “Account Profile”, “Billing & Addresses”, “Ordering Settings”, “Lists” and “Your Content”.

Reference

Amazon.com (2010). Ordering. Retrieved from http://www.amazon.com/gp/help/customer/display.html/ref=hp_navbox_lnor_new?nodeId=524700

3. What happens with new models emerging such as price comparison sites?

As Wikipedia (2010) states, a price comparison service is also know as shopping comparison or price engine allows customers to view the difference prices of the specific products from other websites. The major function of this service is to compare different retailers pricing on a specific product, hence, the customers can find the best deal (ArticlesBase, 2009).

There are three main sites that provide this component are Pricewatch, Pricegrabber, and Nextag. These websites will control and manage most of the market. Accordingly, this will promote the competition between the retailers; they have to give some strategy about prices and quality to attract customer.

References

Articlesbase (2009). Development of price comparing sites. Retrieved from http://www.articlesbase.com/domain-names-articles/development-of-price-comparing-sites-800182.html

Wikipedia (2010). Price comparision service. Retrieve from http://en.wikipedia.org/wiki/Price_comparison_service