Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
See heim

See heim

Ratings: (0)|Views: 92 |Likes:
Published by Marvin Njenga

More info:

Published by: Marvin Njenga on Apr 30, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





Goals of User Interface Architecture
Separation of concerns
Multiplicity of presentation options
Coordination for interactionMain categories of User Interface architecture are
Compiler mentalityLexical/Syntactic/SemanticSeeheim, ARCH
Object mentalityInterface as collection of objectsPAC, MVC
Seeheim metamodel and its successor, the Arch metamodel were proposed to foster theprinciple of separation between interactive code (i.e., dialogue control) and noninteractive code (i.e.,functional core) of computer-based applications. These modelsinfluenced early research efforts in the area of User Interface Management Systems(UIMSs) . There have also been alternative, implementation oriented proposals, some of whichhave resulted from mainstream tools. For instance, the Model ViewController (MVC) The seeheim model
Model-view-controller (MVC)
It is asoftware architecturethat separates an application'sdata model,user interface, andcontrol logicinto three distinctcomponentsso that modifications to one component can be made with minimal impact to the others.MVC is often thought of as asoftware design pattern. However, MVC encompasses moreof the architecture of an application than is typical for a design pattern.Constructing an application using an MVC architecture involves defining three classesof modules.
Model: The domain-specific representation of the information on which theapplication operates. The model is another name for the domain layer. Domain logicadds meaning to raw data (e.g. calculating if today is the user's birthday, or thetotals, taxes and shipping charges for shopping cart items).
lexicalsyntactic semantic
View: Renders the model into a form suitable for interaction, typically auserinterfaceelement. MVC is often seen in web applications,where the view is the HTML page and the code which gathers dynamic data for the page.
Controller: Responds to events, typically user actions, and invokes changes on themodel and perhaps the view.
Many applications use a persistent storage mechanism (such as adatabase)to storedata. MVC does not specifically mention this data access layer, because it isunderstood to be underneath or encapsulated by the Model. The control flow generally works as follows:
 The user interacts with the user interface in some way (e.g., user presses a button)
Acontrollerhandles the input event from theuser interface,often via a registered handlerorcallback.
 The controller accesses the model, possibly updating it in a way appropriate to theuser's action (e.g., controller updates user'sshopping cart). Complex controllers areoften structured using thecommand patternto encapsulate actions and simplifyextension.
A view uses the model to generate an appropriate user interface (e.g., view producesa screen listing the shopping cart contents). The view gets its own data from themodel. The model should have no direct knowledge of the view. However, theobserver patterncan be used to provide some indirection between model and view,allowing the model to notify interested parties of a change. A view object can registeritself with the model and listen for changes but the model itself remains unaware of the view. The controller does not pass domain objects (the model) to the viewalthough it might issue a command telling the view to update itself.
 The user interface waits for further user interactions, which begins the cycle anew.Advantages and disadvantages
Supports multiple views. Because the view is separated from the model and there isno direct dependency from the model to the view, the user interface can displaymultiple views of the same data at the same time. For example, multiple pages in aWeb application may use the same model objects. Another example is a Webapplication that allows the user to change the appearance of the pages. These pagesdisplay the same data from the shared model, but show it in a different way.
Accommodates change. User interface requirements tend to change more rapidlythan business rules. Users may prefer different colors, fonts, screen layouts, andlevels of support for new devices such as cell phones or PDAs. Because the modeldoes not depend on the views, adding new types of views to the system generallydoes not affect the model. As a result, the scope of change is confined to the view. This pattern lays the foundation for further specializations of this pattern such as
Complexity. The
pattern introduces new levels of indirection and thereforeincreases the complexity of the solution slightly. It also increases the event-drivennature of the user-interface code, which can become more difficult to debug.
Cost of frequent updates
Decoupling the model from the view does not mean thatdevelopers of the model can ignore the nature of the views. For example, if themodel undergoes frequent changes, it could flood the views with update requests.
Some views, such as graphical displays, may take some time to render. As a result,the view may fall behind update requests. Therefore, it is important to keep the viewin mind when coding the model. For example, the model could batch multiple updatesinto a single notification to the view.View instability vs. model stability
If constructed correctly, models can enjoy a fair degree of stability(owing to thestability of the domain model), whereas user interface code usually undergoesfrequent and sometimes dramatic change (typically because of usabilityproblems, the need to support growing classes of users, or simply the need tokeep the application looking "fresh"). Separating the view from the model makesthe model more robust, because the developer is less likely to "break" the model while reworking the view.
Attempting to join these two worlds in a hand coded method withoutarchitecture is very common, and results in the model object being polluted withknowledge of the interface, and vice-versa. This makes the code very inflexibleand difficult to maintain. For this reason (among others), many programmingshops develop the user interface design early in the process of design, and freezethe interface early. Swing Features and Concepts
The Java Swing Arhictecture
 The Java Development Kit (JDK) contains a library of classes useful to softwareengineers – the Java Foundation Classes (JFC)Part of the JFC is the Swing package.
  This section shows you all the Swing components and tells you how, in general, tocombine them to create a GUI. Swing provides many standard GUI components such asbuttons, lists, menus, and text areas. It also includes containers such as windows andtool bars.
 Containers use
layout managers 
to determine the size and position of the componentsthey contain. Borders affect the layout of Swing GUIs by making Swing componentslarger. You can also use invisible components to affect layout.
Event handling 
is how programs respond to external events, such as the user pressing amouse button. Swing programs perform all their painting and event handling in theevent-dispatching thread.
means drawing the component on-screen. Although it's easy to customize acomponent's painting, most programs don't do anything more complicated thancustomizing a component's border.
If you do something to a visible component that might affect or depend on its state, then you need to do it from the event-dispatching thread. This isn't an issue for many simpleprograms, which generally refer to components only in event-handling code. However,

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
088nikhil liked this
088nikhil liked this
088nikhil liked this
088nikhil liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->