• No results found

On Integrating Web Services From the Ground Up Into CS1/CS2

N/A
N/A
Protected

Academic year: 2021

Share "On Integrating Web Services From the Ground Up Into CS1/CS2"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

On Integrating Web Services

From the Ground Up Into CS1/CS2

Billy B. L. Lim

Illinois State University

School of Information Technology

Normal, IL 61790-5150, USA

309-438-7589

[email protected]

Chu Jong

Illinois State University

School of Information Technology

Normal, IL 61790-5150, USA

309-438-5212

[email protected]

Pruthikrai Mahatanankoon

Illinois State University

School of Information Technology

Normal, IL 61790-5150, USA

309-438-3315

[email protected]

ABSTRACT

Web services technology is a burgeoning technology that has received tremendous amount of attention in the software industry in recent years under the broader umbrella of service-oriented architecture. While Web services have been incorporated in many industries in the market place, they are only beginning to appear in the academia, primarily in upper division and graduate CS curricula. In this paper, we share our belief that the Web services technology can and should be introduced early in a CS curriculum. We describe a number of scenarios that Web services can be integrated into CS1/CS2 to make them more interesting and more importantly, make the students better prepared for upper division classes and for the industry upon graduation. These scenarios can be incorporated without compromising the core materials presently covered in many CS1/CS2 sequence.

Categories and Subject Descriptors

K.3 [Computers& Education]: Computer & Information Science

Education – Computer Science Education

General Terms

Design, Experimentation, Languages

Keywords

Web services, service-oriented architecture, Teaching CS1/CS2

1. INTRODUCTION

The introductory programming sequence in computer science has seen its share of changes, in terms of evolution, over the last few decades. From a primarily mainframe based delivery of the courses, through the use PCs and its accompanying graphical user interfaces (GUIs), to the use of the Web in recent years, the

introductory sequence has evolved to meet the needs of the IT industry.

During the above period of change, the paradigm shift from procedural to object-oriented (OO) approach to problem solving can also be observed. This is again attributed to the moving forces of IT market where the industry essentially led the movement toward the use of OO technology for software development. This is evidenced from the adoption of OO programming languages such as Smalltalk, C++, Java, and C# in the industry and then in CS1 and CS2 over the years.

Now, similar observation can be made about how the software industry is embracing another wave of change in software development technologies. This time it involves service-oriented architecture (SOA), particularly the use of Web services to speed up application development and reduce costs to access data on disparate systems.

For many years, software reuse and systems interoperability have been primary goals of many IT organizations as means to curb software cost. These organizations have software applications that use the Internet/Web to transfer data, interoperate, and conduct business transactions. OO technology has been utilized to accomplish these goals with relative success over the years. Nevertheless, there are many hurdles that OO technology itself could not overcome.

One of them is due to lack of standards. A software component developed in one vendor’s technology cannot easily communicate with another vendor’s. This is evidenced from the failure of major distributed OO technologies such as CORBA, DCOM, and RMI from becoming mainstream software development technologies. Another difficulty is due to the fact that the majority of software applications reside behind firewalls – security barriers that restrict communication between networks. Here, even if two systems use the same protocol to communicate, the security of firewall prevents the communications from taking place.

Web service [1,3,4,10,11] is the latest buzzword in the industry to address the problems identified above. Web service model is one that utilizes loosely-coupled, platform and language neutral framework for designing the next generation distributed systems. It is based on technologies by the W3C, the international

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee.

Conference’04, Month 1–2, 2004, City, State, Country. Copyright 2004 ACM 1-58113-000-0/00/0004…$5.00.

(2)

standard body that oversees various Web related technologies. It also has strong support from major industry players such as Microsoft, IBM, Sun, HP, and Oracle. As such, it is projected to be a strong technology that many IT organizations will investigate and adopt if proven viable. In fact, Gartner Research compared Web services with previous attempts and stated that this time things may be different because “With Web services, all the major vendors are on board with their support.”

Recent studies on Web services have also shown the growth and acceptance of the technology. According to ZapThink, a market research firm, the market for Web services platforms, application development suites, and management tools is projected to expand from a $380 million (US) market in 2001 to over $15.5 billion (US) in 2005. Also, recent survey by market research firm TechMatrix (of 450 IT professionals and consultants) finds that 65% of small and midsize companies and 35% of large companies have adopted Web services to automate business processes between trading partners and for internal application integration. Another important observation is that the use of Web services is now widespread in many industries including retail, financial services, homeland security, transportation, etc.

With the above stunning growth, it is inevitable that Web services will be integrated into CS curricula sooner or later, if history is of any indication. It is thus a natural evolution for CS1/CS2 to begin exposing the beginning students with this burgeoning technology early on given the current trend of software development. This will not only fascinate the students with its interesting collection of activities (see Section 3), but also inspire and prepare them for real-world software development scenarios when they graduate. First-year undergraduates rarely get the exposure to these technologies because of the need to get to the fundamentals of computing first. This paper describes strategies that can be employed without compromising these fundamentals.

Given today's economic climate and the offshore outsourcing trend to countries such as India and China, which arguably has led to higher programmer unemployment, the adoption of more exciting technologies at the beginning level may help to attract and retain more students. Web services hold great promise in this respect and they are expected to be integrated into the CS curricula pervasively in the years to come.

In fact, it should be noted that efforts are beginning to surface in some CS curricula in the form of upper-division/graduate, seminar type class (e.g., [7,16]). However, it is our belief that ideally one should start to lay the foundation of SOA in the form of Web services in introductory programming courses. Eyeing on the popularity and importance of Web services, their economic argument [2], the need to keep CS curricula as up-to-date as possible, and the importance of laying the right foundation early on, it is thus the goal of this paper to describe scenarios that are viable for integrating Web services into CS1/CS2.

The remainder of the paper is organized as follows. Section 2 gives a brief overview of the underlying technologies behind Web services. The aforementioned scenarios for integration are detailed in Section 3. Section 4 provides a discussion of the implementation of the scenarios, and finally the summary and conclusions are given in Section 5.

2. WEB SERVICES

In a nutshell, Web services can simply be thought of as self-describing services that are HTTP-addressable, i.e., Web-callable. This means that one can shop for a software service much like one can shop for goods on the Web, using exactly the same protocol. Web services relies on SOAP (Simple Object Access Protocol), WSDL (Web Service Description Language), and UDDI (Universal Description, Discovery, and Integration) as the underlying technologies for involved parties to communicate and produce/consume a Web service, as shown in Figure 1. Here, a scenario that shows a brokerage house registering its stock quote service with a registry and a financial software finding and consuming the service is depicted.

Behind the scene, SOAP uses HTTP as the protocol to transmit its message, which is in XML format. This powerful combination of HTTP and XML, both standards of W3C, provides a fully extensible mode of communication between loosely-coupled software systems. The interoperability and scalability of Web services means that developers can rapidly create larger applications and Web services from smaller ones. This adds another dimension to the Web; instead of just person-to-person or person-to-system, it also handles system-to-system.

Given that HTTP is a firewall friendly protocol and XML is becoming more and more popular as a standard for data exchange, it is not surprising that Web services has received so much attention in the industry, including new journals such as International Journal of Web Services Research and Web Services Journal for the coverage of the topic [9,17]. It is the buzz that all major IT corporations are talking about and it is also the centerpiece of the .NET campaign of Microsoft [5], a technology that Microsoft is staking its future in, with $4 billion initial investment.

This new way of application development is mimicking how hardware vendors have been producing hardware components for years. Now, the software vendors even have the Web, one of the most important revolutions in the computer industry, on their side. As stated by Bill Gates [5], Chairman of Microsoft, “The power of the XML Web Services model is amazing. A company offering an online electronic-payment service can expose its service to partners, so that they can deliver it as part of their own offering – regardless of what platform they are using. An airline can link its online reservation system to that of a car-rental

! find service " publish service

(e.g., stock quote)

Service Registry (e.g., IBM UDDI service)

Service Provider (e.g., Brokerage House) Service Requester (e.g., XYZ Financial Software) # bind to service

Figure 1: Life Cycle of a Web Service Execution (Registry, Lookup, and Consumption)

(3)

partner, so travelers can book a car at the same time they book a flight. … XML Web services help your business break free of its boundaries.”

3. WEB SERVICES SCENARIOS FOR CS1/

CS2

This section provides numerous scenarios on how various topics that are typically covered in CS1 or CS2 may be easily enhanced so that students can be exposed to a burgeoning state-of-the-technology – Web services. The scenarios are presented by listing a topic in question, its typical delivery mechanism, its Web services delivery alternative, and finally an example depicting an instance of the scenario. Miscellaneous comments may also be provided under the "Other" subsection.

3.1 Method Invocation

Typical Delivery: This topic is typically covered for methods that are local to the caller's address space or library routines that are external but still from within the same system space.

Web Services Based Delivery: Instead of merely calling methods that are on the same address space, introduce the notion that some methods may have been written by others and that these methods (i.e., Web services) are scattered all over the world but they are callable from the Web.

Example: The Web service method sayHello() may be coded to return "hello" if called from a local machine but return hello in the respective foreign language if the called method is housed in a foreign country (e.g., "你好 (ni hao)" from China, "hola" in Mexico, "konnichiwa" in Japan). This "hello world" of Web services allows the students to be exposed to the new world of SOA with minimal complexity.

Other: The introduction of Web services in this scenario opens up many opportunities to discuss various other subject areas as well. In addition to Web services (SOA in general), one can discuss distributed computing and network communication in general. Also, because of the use of foreign characters, one can talk about character encoding schemes. Lastly, the concept to polymorphism can also be tied to the above when one considers how the objects from different countries are reacting in their own ways (of saying hello) to the same message.

3.2 Sequence, Iterative, and Decision

Structures

Typical Delivery: These topics are typically covered by traditional discussion of scenarios that (1) necessitate a certain ordering be imposed in order to solve a problem (e.g., read the input values before processing them), (2) require a loop be used (e.g., processing a collection of numbers to find the average), and (3) need an if-else structure be employed (e.g., find the largest and smallest numbers from a collection of numbers).

Web Services Based Delivery: Instead of merely processing a collection of numbers that may be meaningless (and boring to the students), one could present a scenario where the goal is to solve a problem by using the three fundamental structures and some

existing Web services that can be composed to form a solution for the problem.

Example: A plausible scenario here is to discuss a problem where one wishes to find out the warmest temperature in all the U.S. by zip codes at a particular moment in time. Further, the warmest area of the country needs to be plotted on a map.

This scenario, which is much more interesting for today's freshmen, may seem intractable in the traditional CS1/CS2 environment. But there exist various publicly available Web services that can be composed together to solve this problem rather effortlessly. There exists one that retrieves all the US zip codes (GetZipCodes) [14], another one that finds the temperature given a zip code [18], and yet another one that plots a particular area on a map given a zip code (MapPoint Web service) [12]. Thus, one can cover the sequence, iterative, and decision structures all in one shot in the above example.

Other: Variations of the above can easily be done if one wishes to get "closer to home" to find temperatures that are in one's neighborhood. There are Web services that retrieve all the zip codes within a given radius mile of another (e.g., GetNearbyZipCodes [15]) and ones that calculate the distance between two given zip codes (e.g., [8]). With these Web services, one can for example create exercises that require two different computations of all the areas that are within, say, 50 miles radius of a city like Chicago given the zip codes.

3.3 Sorting and/or Searching

Typical Delivery: This topic is typically covered by discussions on various sorting and searching methods and their respective Big-O complexities. This is typically followed by examples of applying the algorithms on records of interest such as ranking the top 10 NCAA teams and searching for a team given some criteria.

Web Services Based Delivery: Web services call can be made to return the result of a sort or search, whether this is via publicly available or internally developed Web services.

Example: Web services that implement linear search, binary search, bubble sort, and quick sort may be provided for the students to experiment with and gather the performance of the algorithms. Here, a discussion of the different Big-O notations for the implemented algorithms may be reinforced. Also, students may be asked to observe any network latency as part of the experiments and discuss how the delays compare to the overall performance timings of the algorithms.

3.4 Miscellaneous Data structures

Typical Delivery: This topic is typically covered by discussing scenarios that require the use of compound data structures (e.g., stacks, queues, trees) to effectively produce results for certain problems. For example, one may discuss a simulation of supermarket queues (express lane or otherwise) after the queue and related data structures are presented. The typical scenarios generally do not involve the use of Web.

Web Services Based Delivery: To make the discussions and potential exercises more interesting, students can be required to

(4)

consume Web services that directly produce the data structures of interest. Alternatively, they may be asked to create such data structures from the results of Web services themselves to handle the application requirements.

Example: A plausible scenario is to expose the students to the Google Web services API [6] where instead of going to google.com to do searching, a customized version (e.g., better user interface or "create a novel UI for searching" as Google puts it) can be built to serve their own interests. Here, we are still relying on Google's powerful search engine to scour the Web, but we can add the bells and whistles (e.g., add spell check) to make the search experience more fruitful. A discussion of how Google or other search engines typically organizes its data can then follow. For example, Google Directory reuses the data provided by the Open Directory Project and constructs a hierarchical list of Web sites [13]. Instead of generating a compound data structure and constructing a traversal algorithm, the service traverses up and down the already constructed directory tree to get the information to the caller.

Another possibly is to manipulate the search results from a service (one needs to examine the Terms and Conditions carefully here) and create the appropriate data structures that are best suited for the application requirements.

Other: With the above scenarios, one can discuss the concept of Web portals and how Web services are at the core of designing and implementing the portals.

3.5 Use of Different OS

Typical Delivery: For some CS curricula, including one from the authors' institution, part of the introductory sequence needs to expose students to an environment that is other than the "main" one. For example, Windows environment that runs Java may be the main environment that supports the main course activities while an alternate one may be Java on Linux or OS390. Here, the rationale is to expose the students to multiple OSes and students are typically given a small program to do in the alternative environment.

Web Services Based Delivery: Instead of developing just another program that runs on an alternative environment, students may be shown how to develop a Web service and be challenged to create a useful Web service in a motivating context. Then, one possibility is to require the students to consume the Web service that they have just built. This allows for a discussion on across platforms interoperability when the consumer interoperates with the producer.

Example: A Web service on the aforementioned GetZipCodes may be developed and the same service consumer discussed earlier may then be used to consume the newly created Web service. This service may, for example, read from a file that contains all the zip codes and return them to the caller.

4. DISCUSSION

First and foremost, it should be noted that the scenarios and activities discussed in Section 3 are merely intended to be ones that can be used to integrate Web services into CS1 or CS2 and expose students to an increasingly important topic without

compromising the core of the courses. They are not intended to replace any of the core topics and their use should be considered an experiment at this point in time.

This experiment is currently being investigated in CS2 at the authors' institution. It is anticipated that the overhead of introducing Web services would be minimal given that in many of scenarios, "black-box" approach would be used. The underlying details are not expected to be fully disclosed until an upper division course that hopefully has a segment that reveals the components of Web services.

Also, with today's technologies, consuming an existing Web service or developing a new one is a relatively easy proposition. For example, to consuming a Web service in Microsoft Visual Studio.NET environment, one needs to simply provide the URI (Uniform Resource Identifier) of the Web service and include it as a Web reference in the Solution of the project being built, all of which can be accomplished via point-and-click. Then, to invoke a service, one simply instantiates an object from the associated proxy class (included in the Web reference) and makes a method call.

Similarly, to develop a Web service, one needs to simply create a Web Service project in VS.NET and tag the method that is to be exposed using the [WebMethod] attribute, i.e., just insert this attribute before the method! When done, the method is now exposed and is callable as a Web service.

Both the consumption and the development of Web services can also be achieved easily using technology from the other camp, i.e., Java. Many Java IDEs (e.g., Oracle JDeveloper, Borland JBuilder, IBM Websphere, Sun Java Studio, etc.) provide functionality that is comparable to Microsoft VS.NET and allow for simple integration of Web services technology.

As for the coverage of the general topic of Web services (this is a true overhead as this topic is not known to be covered in any CS1 or CS2 course), this can conceivably be introduced when the general introduction to software engineering is given. An estimate is that no more than 1-week of coverage should be dedicated to this introduction with Web services being a major component here. SOA is changing the landscape of software engineering and Web services technology is at the heart of this evolution and thus deserves the spotlight and time coverage.

5. SUMMARY AND CONCLUSIONS

As industry leaders collaborate to standardize Web services, we can speculate that next generation distributed systems will adopt various Web services-related technologies. Many businesses are currently in the process of implementing the technology to automate their business activities. By exposing our CS students to this concept early on, they will be equipped with the state-of-art software development skill and the knowledge to actively participate in this new industry trend.

Some educators may suggest that Web services should be taught to upper-division undergraduate students, until most students are fully exposed to various concepts in the field, e.g., distributed computing, operating systems, databases, etc. However, we suggest that by integrating Web services to the first-year CS curriculum may not only help to attract and retain more students,

(5)

but will also provide us with newer, advance teaching plans for our upper-division students. Although our examples offer general guidelines of what could be done in the CS1/CS2 level courses, we are equally eager to incorporate Web services vertically as well as horizontally into other curricula, i.e., telecommunication and information systems majors. We anticipated that the overhead of introducing Web services would be minimal given that several of the basic courses requirements of these majors were similar. If “the power of the XML Web Services model is amazing”[5], then this could be the time to introduce such technological foundation to our future IT professionals.

6. REFERENCES

[1] Benfield , S., “Web Services: XML’s Killer App,” Java Developers’ Journal, Vol. 6, No. 4., 2001.

[2] Booch, G., “Web Services: The Economic Argument,”

Software Development, Vol. 9, No. 11, November, 2001. [3] Curbera, F., et al., “Unraveling the Web Services Web,”

IEEE Internet Computing, march/April, 2002. [4] Dyck, T., “Web Services Wave” (the Cover Story: Web

Services Wake-Up Call), eWeek, Vol. 18, No. 35, September, 2001.

[5] Gates, W., Microsoft .NET Today, an open letter to the Developers & IT Professionals, June 14, 2001.

[6] Google Web services API, http://www.google.com/apis/ [7] Humphrey, Marty, "Web Services as the Foundation for

Learning Complex Software System Development," 35th SIGCSE Technical Symposium on Computer Science Education, Norfolk, Virginia USA March 3 - 7, 2004 [8] Imacination, http://webservices.imacination.com/distance/

[9] International Journal of Web Services Research,

http://www.idea-group.com/journals/details.asp?id=4138 [10] Kiely, D., “WSDL for Defining Web Services,” Cover

Story, XML Magazine, Vol. 2, No. 4, August/September, 2001.

[11] Lim, Billy B. L., Wen, H. J. “Web Services: An Analysis of the Technology, its Benefits, and Implementation

Difficulties,” Information Systems Management, Vol. 20,

No.1, Spring 2003, pp. 49-57.

[12] Mappoint,

http://www.microsoft.com/mappoint/default.mspx [13] Ntoulas, A., Cho, J., and Olston C., "What’s New on the

Web? The Evolution of the Web from a Search Engine Perspective," WWW2004, May 17-24, New York, NY, USA. [14] Remotemethods,

http://www.remotemethods.com/home/valueman/validati/zip codes

[15] Teachatechie,

http://teachatechie.com/GJTTWebServices/ZipCode.asmx [16] Weaver, A., Peden, J., “Integrating Web Services into the

Undergraduate Computer Science Curriculum,” National Science Foundation, CISE Education Research and Curriculum Development Program, January 12, 2004. [17] Web Services Journal, http://www.sys-con.com/webservices/ [18] Xmethods,

References

Related documents