Rizvi S.A.M. and Syed Imtiyaz Hassan, "Managing Input Events of Interactive Software System Based on MVC and .Net Framework", in proc. of IEEE International Advance Computing Conference (IACC’09), Thaper University, Patiala, India, March 6-7, 2009, pp. 2385-2387, ISBN: 978-981-08-2465-5. Managing Input Events of Interactive Software System Based on MVC and .Net Framework Dr. S. A. M. Rizvi Department of Computer Science Jamia Millia Islamia University, New Delhi, India Syed Imtiyaz Hassan Department of Computer Science Hamdard University, New Delhi, India Abstract— Abstract-The Model-View-Controller (MVC) design pattern is a standard pattern for interactive applications. The paradigm is based on factoring a system into three parts: Model, View and Controller. The Controller is responsible for intercepting the input event generated by keyboard or mouse through user interface and collaborates with the Model and associated Views. The Model contains the state, behavior and application logic to access and to store the persistent data. A View is responsible for displaying output created by the Model. Adherence to MVC pattern enables both abstraction of logic, and reuse of code. However a question has been raised at usability of Controller in modern GUI operating systems like MS-Windows or frameworks like .Net that provide a set of native widgets and controls for constructing user interface, as the widgets available in such framework are able to handle input events independently. It has been observed that there is no such problem in MVC. In order to create a Controller which manages the input events of the system developed using such framework, it is necessary to break input events into two categories: Local event and System event. This paper demonstrates how these events can be classified with the help of sample implementation using C# programming language on Microsoft’s .Net framework. Keywords- MVC; User Interface Design; Human Computer Interface (HCI); Design Pattern; Reusable Code. I. INTRODUCTION From the early days of object-oriented programming, the Model-View-Controller (MVC) [8] design pattern has been used to develop interactive applications having multiple user interfaces due to the inherent benefits it offers as a result of factoring. Adherence to MVC increases the reusability of the various components and improves the maintainability of the overall system. Due to the separation of components in the MVC, multiple Views can be associated with the same Model. As a Model does not have any dependency on its Views, the different Views of the same Model can also be implemented in different platform leading to code reuse of Model [7]. Due to the advantages it offers, the MVC has been adopted by Java programmers as Sun Microsystems has used it extensively for the Swing GUI toolkit [5] and enterprise applications. Even the Microsoft’s .Net framework [9] uses MVC as the core design pattern. The .Net framework provides the rich set of user interface components for building GUI applications. All these GUI widgets and controls have been provided with the ability to manage different input events itself. In MVC, the Controller act as a listener of input events and responds accordingly. This can produce a role conflict as the input events can be managed by View as well as Controller. This paper with the help of a sample implementation in .Net framework will show that how to avoid such conflict by segregating those events which is local to the View and does not has any impact on other component with those of system-level events. II. THE ORIGIN OF OBJECT ORIENTED USER INTERFACE The concept of object-oriented system was originated with the Simula [3] as an extension to the ALGOL programming language. Smalltalk [4] enhanced the same concept with the aim of creating the exemplary object oriented language. Smalltalk also emphasized the object-oriented user interface, so that objects can be presented visually on the screen through text, menus, pictures etc. and can be manipulated through keyboard activity or through pointing device. MVC was conceived in 1978 as the design solution to develop systems with different user interfaces so that the users can inspect and edit the relevant information in different forms and with ease. An application based on MVC is factored in three classes of modules as depicted in Fig. 1. Model: A representation of state, structure and behavior of the domain specific information of the application. View: User Interface element to render Model for meaningful representation and manipulation. Controller: An event listener that responds to an event and changes the Model or the View. III. RELATED WORK Below is the short review of the notable works done on design patterns for developing interactive software system. Fig. 1. MVC architecture (adapted from [8] )