Programming Paradigm Edited

download Programming Paradigm Edited

of 22

  • date post

    07-Jul-2015
  • Category

    Documents

  • view

    44
  • download

    0

Embed Size (px)

Transcript of Programming Paradigm Edited

By Asomah Eric

CONTENTSContents..................................................................................................................................1 Introduction.............................................................................................................................2 Comparative evaluation of suitable paradigm for the application...........................................3 Choice of Paradigm and Justification.......................................................................................5 Second best choice.................................................................................................................6 Algorithm design for the application.......................................................................................8 Designing an algorithm in pseudocode to represent some of the users activities..............11 Conclusion.............................................................................................................................15 References............................................................................................................................15 Appendices.........................................................................................................................16 Screen shots...................................................................................................................16 Appendix II.........................................................................................................................22 System Requirements.....................................................................................................22

1|Page

By Asomah Eric

INTRODUCTION The speeding need of the changing world with responds to information seemed partially solved with the advent of internet and the web technologies. This has now become more pressing than ever due the business needs, social needs and governmental needs. These needs have therefore called for complex systems to be developed and solve organizations, government and societal problems. FlyBe as an emerging Airline company to join the many existing once, has no choice but have to compete in this complex environment as describe above. Due to globalization, airline companies today are able to operate globally and hence the need to rely on some of these technologies to meet the demands of their global customers. This explains why every airline is having a website or a web application to mange their booking and the general operations of the airline. For FlyBe to enter into this market and compete effectively there is a need for the company to result to web technology which will help the new Airline Company to grow and mange its booking to reach both local and global market. As a software engineer, I have been called to develop an online reservation system for FlyBe. But there are various programming paradigms to look at before the best choice can be made to help solve FlyBes problem of the current competition ahead and make the company a player in this market.

2|Page

By Asomah Eric

COMPARATIVE

EVALUATION

OF

SUITABLE

PARADIGM

FOR

THE

APPLICATION There are different programmings paradigms that have been existing over the years, which are characterized by their time of origin or how they are programmed or what problem they are able to solve and or their approach to problem solving. Some of these paradigms can be summarize as below:

Imperative/ Algorithmic

Algorithmic

Object-Oriented

Functional Programming Algol Cobol PL/1 Ada C Modula-3 Lisp Haskell ML Miranda APL Lisp

Logic Programming Prolog Smalltalk Simula C++ Java Smalltalk C#

Table 1 Comparative evaluation of different paradigms (Adopted from: http://www.seas.gwu.edu/~bell/csci210/lectures/programming_paradigms.pdf, 19the July, 2011)

3|Page

By Asomah Eric

IMPERATIVE APPROACH With the Imperative approach, the codes are written to describe in exacting detail the steps that the computer must take to accomplish the goal. This is sometimes referred to as algorithmic programming (msdn, 2011). The various examples of the paradigm are as listed in the table1 such as C, Ada, COBOL etc.

DECLARATIVE APROACH The Declarative is divided into Functional and Logic paradigms. The functional paradigm is clearly created to support a pure functional approach to problem solving which broke away from declarative programming. In comparison with imperative paradigm, functional approach involves composing the problem as a set of functions to be executed. The input to each function and what each function returns are critically assigned (msdn, 2011). The logic program defines a set of relations. This definition of relations can therefore be used in various ways by the interpreter to solve different queries which is not so in other paradigms which make use of explicitly how the declarative message is used to solve the query (msdn, 2011). OBJECT-ORIENTED With the demands and the pressure for more complex technologies, hardware has been able to play its role in terms of re-usability, maintenance and cost. Whiles software has still remained in crises. The crises in the software are the sense of its high cost of maintenance as compare to its development as there is continues quest for complex and challenging systems to be built (Buyya, 2009). This resulted in the need to create more robust software that is reusable. The knowledge of this gave birth to the object oriented Paradigm, which treats data-fields as "objects" which is controlled through pre-defined methods.

4|Page

By Asomah Eric

Bellaachia (2011) argued that OO programming paradigm is not just a few new features added to a programming language, but it a new way of thinking about the process of decomposing problems and developing programming solutions. Agreeing to this, OOP offers the most divers ways of approaching a complex problem than the other paradigms. The OOP is known of using physical modules and data abstractions to approach to any project of any size (Buyya, 2009). The typical traits of an OO-P are Object-based features, Inheritance and Polymorphism. Considering all of the paradigms, the most suitable paradigm to solve FlyBes problem of developing online reservation system is the Object-Oriented paradigm.

CHOICE OF PARADIGM AND JUSTIFICATION The OO-P approach has been chosen for the FlyBe Online Reservation system because of the complexity of the application or the system. The OO-P as discussed above offers a great understanding of the various modules that needs to be created and breaks the code of complexity into simple easy ones. The other interim reasons for the OO-P paradigms as a choice is because it has improve tremendously on the structured programming paradigm, it has places emphasis on data rather than algorithms and it has satisfy procedural abstraction with data abstraction. Data and associated operations are unified through the grouping of objects with common attributes, operations, and semantics (Buyya, 2009). The choice of programming language within the OO-P domain for the FlyBe Online Reservation system is C#. The programming language has been chosen in expense of others because of its robustness, simplicity, modern and general purposeless. Since the system is going to be an online application or web application, it also motivated its selection. C# has been rated among the best Object-Oriented Programming which is good for web application development by taken advantage of the .Net framework (Obasanjo, 2007). It facilitates application development within the shortest possible time and hence helping developers to meet deadlines of projects. Scheduling or meeting5|Page

By Asomah Eric

project time lines are as important as any other activity in the project because the delay in the project may lead to increase in cost and quality. Since the time line for the FlyBe system is so short, it is therefore arguably important to select C# to facilitate the speed of development and cut down cost. Some of the main features of the C# programming language that led to its selection in this project are as follows: shorten development time by developers not to worry about memory management, type safety, building low level libraries, array bounds checking and many others, which gives more time for module logic construction (Obasanjo, 2007). The Common Language Runtime in C# is well designed and considered better than the JVM. The CLR makes sure that the execution of both managed and unmanaged codes are taken care of (Nguyen, 2011). The C# programming language is better to use in applications such as the one under development since, windows has the big market in the Personal Computing market, and hence many users are using windows OS and will interface well with the Online application for the airline (FlyBe). The language also offers good metadata, which allows class to be more expressive (Nguyen, 2011). This accounts for the reason why the language is easy to learn and many developers are grapping it. Nguyen (2011) argued that the SWF is faster than Swing in Java most of the time The C# makes use of GUI development environment like the Windows Forms which provides powerful support for Data Binding and facilitates population of web pages with data from the database environment. The inbuilt XML documentation tags are handier and make it easier for data streaming. The above factors, therefore led to the selection of the C# Object-Oriented Programming language for the FlyBe Online Reservation System (FORS).SECOND BEST CHOICE

The programming language other than the C# above would be Java. Both languages are chosen from the OO-P paradigm. C# is much more like Java in terms of syntax and the style of coding. Th