background preloader

Good To Knows

Facebook Twitter

Http Authentication. Overview The HTTP protocol handler implements a number of authentication schemes. Sun's implementation of Java SE Version 6 supports the following: HTTP Basic authentication (RFC2617)HTTP Digest authentication (RFC2617)NTLM (defined by Microsoft)Http SPNEGO Negotiate (defined by Microsoft), with the following underlying mechanisms: KerberosNTLM Each of these schemes is described in more detail below, but they are typically used by application code in much the same way. The java.net.Authenticator class is used to enable authentication and to provide access to a store of usernames and passwords which are then used in the respective authentication schemes. Generally, all authentication schemes work with both proxies and servers. Some (basic and digest) can be used simultaneously with proxies and servers. See below for how to distinguish between proxy and server authentication. How to use the Authenticator class Extending java.net.Authenticator Enabling authentication Http Basic Http digest.

Stateful is beautiful.

Domain Driven Design

FLUENT. FUNCTIONAL. Passive View. A screen and components with all application specific behavior extracted into a controller so that the widgets have their state controlled entirely by controller. A perennial problem with building rich client systems is the complication of testing them. Most rich client frameworks were not built with automated testing in mind. Controlling these frameworks programaticly is often very difficult. A Passive View handles this by reducing the behavior of the UI components to the absolute minimum by using a controller that not just handles responses to user events, but also does all the updating of the view. How it Works This pattern is yet another variation on model-view-controller and model-view-presenter. Figure 1: Unlike most MVC-style configurations, Passive View results in no dependencies between view and model. Figure 2: When the actual text is edited, all the UI response is handled by the controller.

Figure 3: Classes for the assessment example. When to use it Significant Revisions. Supervising Controller. Factor the UI into a view and controller where the view handles simple mapping to the underlying model and the the controller handles input response and complex view logic. [TBD: Not sure yet whether to use the word 'controller' or 'presenter' here.] Many UI frameworks provide the ability to easily map between the view and model, often using some kind of Data Binding. These approaches are very effective in allowing you to declaratively set up a relationship between elements in the view and model.

Usually, however, there are more complex relationships which require you to have more complex view logic. This logic can be hard to manage, and in particular hard to test, while embedded in the view. Supervising Controller uses a controller both to handle input response but also to manipulate the view to handle more complex view logic. It leaves simple view behavior to the declarative system, intervening only when effects are needed that are beyond what can be achieved declaratively. How it Works. Presentation Model. Represent the state and behavior of the presentation independently of the GUI controls used in the interface Also Known As: Application Model GUIs consist of widgets that contain the state of the GUI screen. Leaving the state of the GUI in widgets makes it harder to get at this state, since that involves manipulating widget APIs, and also encourages putting presentation behavior in the view class.

Presentation Model pulls the state and behavior of the view out into a model class that is part of the presentation. The Presentation Model coordinates with the domain layer and provides an interface to the view that minimizes decision making in the view. Presentation Model may interact with several domain objects, but Presentation Model is not a GUI friendly facade to a specific domain object.

Presentation Model is known to users of Visual Works Smalltalk as Application Model How it Works To do this the Presentation Model will have data fields for all the dynamic information of the view. Introduction à la Programmation Orientée Acteurs. Depuis le milieu des années 2000, l’augmentation de la puissance de calcul de nos ordinateurs ne passe plus par l’élévation de la fréquence des processeurs mais par la multiplication des cœurs de processeur au sein de nos machines.

Pour tirer parti de cette multiplication, un algorithme doit être parallèlisé, c’est à dire qu’il doit pouvoir diviser ses instructions et les répartir sur différents cœurs pour une exécution simultanée. De nombreux outils permettent d’implémenter un algorithme parallèle sur une machine, par exemple la librairie Task Parallelism Library (TPL) en .Net, abordé par Olivier Roux et Alexis Flaurimont ou encore le fork/join en Java étudié par Marc Bojoly et David Rousselie.

D’autres outils, implémentant par exemple le pattern Map/Reduce, permettent de distribuer le calcul vers des cœurs situés sur différentes machines. Cet article présentera une introduction à la programmation orientée acteurs et les réponses qu’elle apporte à ces différents problèmes. 1. 2. 3. Design pattern in simple examples.