CSA 1019 Imperative and OO Programming

Størrelse: px
Starte visningen fra side:

Download "CSA 1019 Imperative and OO Programming"

Transkript

1 CSA 1019 Imperative and OO Programming Design Patterns Mr. Charlie Abela Dept. of of Artificial Intelligence

2 Objectives Getting familiar with Defining design patterns Catalog Perspective Object Oriented Approach Design Patterns Templates Design Patterns Categories Design Patterns Considered Charlie Abela CSA1019: Design Patterns 2

3 Defining Design Patterns If If a problem occurs over and over again, and a solution to to that problem has been used effectively. That solution can be be described as as a pattern. Design patterns are language-independent strategies for for solving common objectoriented design problems. Design patterns are are just convenient ways of of reusing object-oriented code between projects and between programmers. The idea behind design patterns is is simple-- write down and catalogue common interactions between objects that programmers have frequently found useful. One of of the the most influential works about design patterns was published in in the the book, Design Patterns Elements of of Reusable Software, by by Gamma, Helm, Johnson and Vlissides.(1995). This book is is commonly referred to to as as the the Gang of of Four or or GoF book Charlie Abela CSA1019: Design Patterns 3

4 Popular Design Pattern One One of of the the most most frequently cited cited frameworks is is the the Model-View-Controller framework for for Smalltalk [Krasner and and Pope, 1988], which divided the the user user interface problem into into three three parts. The The parts parts were were referred to to as as a data data model model which which contain contain the the computational parts parts of of the the program, the the view view which which presented the the user user interface, and and the the controller, which which interacted between between the the user user and and the the view. view. Each Each of of these these aspects of of the the problem is is a separate object and and each each has has its its own own rules rules for for managing its its data. data. Communication between the the user, user, the the GUI GUI and and the the data data should be be carefully controlled and and this this separation of of functions accomplished that that very very nicely. Three objects talking to to each each other other using this this restrained set set of of connections is is an an example of of a powerful design pattern. Charlie Abela CSA1019: Design Patterns 4

5 UML Class diagrams in one slide Charlie Abela CSA1019: Design Patterns 5

6 Object Oriented Approach The The fundamental reason for for using various design patterns is is to to keep keep classes separated and and prevent them them from from having to to know too too much about one one another. There are are a number of of strategies that that OO OO programmers use use to to achieve this this separation, among them them encapsulation and and inheritance. Inheritance is is one one of of the the most most important capabilities of of OO OO since since a a class class that that inherits inherits from from a a parent parent class class has has access access to to all all of of the the public public methods and and variables of of that that parent parent class. class. However by by starting your your inheritance hierarchy with with a complete, concrete class class you you may may be be unduly restricting yourself as as well well as as carrying along specific method implementation baggage. Instead, it it is issuggested that that you you always Program to to an an interface and and not not to to an an implementation More succinctly one one should always define the the top top of of any any class class hierarchy with with an an abstract class, which implements no no methods, but but simply defines the the methods that that the the class class will will support. Then, in in all all of of the the derived classes there there is is more more freedom to to implement these these methods as as most most suits suits the the purposes. Charlie Abela CSA1019: Design Patterns 6

7 Object Oriented Approach (cont) The other major concept one should recognize is is that of of object composition. This is is simply the the construction of of objects that contain other objects: put simply, encapsulation of of several objects inside another one. While many junior OO programmers use inheritance to to solve every problem, for for more elaborate programs, one has to to consider object composition. The new object can have the the interface that is is best for for what needs to to be be accomplished without having all all the the methods of of the the parent classes. Thus, the the second major precept suggested by by Design Patterns is: is: Favour object composition over inheritance. At At first this seems contrary to to the the customs of of OO programming, however this is is frequently used in in different cases among the the design patterns where the the inclusion of of one or or more objects inside another is is the the preferred approach. Charlie Abela CSA1019: Design Patterns 7

8 Example Inheritance class class Fruit Fruit { //... //... } class class Apple Apple extends Fruit Fruit { //... //... } Composition public class class Fruit Fruit { //... //... } public class class Apple{ private Fruit Fruit fruit fruit = new new Fruit(); //... //... } Fruit Fruit Apple Apple - Fruit: fruit Charlie Abela CSA1019: Design Patterns 8

9 Design Patterns Catalogue Design Patterns, as as described in in the GOF book are considered to to be a catalogue of of 23 generally useful patterns for writing object-oriented software. It It is is written as as a catalogue with short examples and substantial discussions of of how the patterns can be constructed and applied. Charlie Abela CSA1019: Design Patterns 9

10 Design Patterns Templates Design patterns are are generally described using a consistent format making them more easy to to learn, compare and use. Design Patterns (in (in the the GOF book) uses the the following template: Pattern name and and classification: A conceptual handle and and category for for the the pattern Intent: What problem does does the the pattern address? Also Also known as: as: Other common names for for the the pattern Motivation: A scenario that that illustrates the the problem Applicability: In In what what situations can can the the pattern be be used? Structure: Diagram using the the Object Modelling Technique (OMT). Participants: Classes and and objects in in design Collaborations: How How classes and and objects in in the the design collaborate Charlie Abela CSA1019: Design Patterns 10

11 Design Patterns Templates (cont) Consequences: The main objectives that the the pattern achieves and the the tradeoffs involved Implementation: Pitfalls and hints that one should be be aware of of when implementing the the pattern Sample code: Sample code in in illustrating possible implementation Known uses: Examples of of the the use of of the the pattern in in the the real world Related patterns: other design patterns which are are closely related to to this pattern Charlie Abela CSA1019: Design Patterns 11

12 Design Patterns Templates (cont) The book, Patterns in in Java uses a slightly different type of of template and the the implementation is is based on on Java. Template includes: Pattern Name: The The name and and a reference to to where it it was was first first described Synopsis: A very very short short description of of the the pattern Context: A description of of the the problem the the pattern is is intended to to solve Forces: A description of of the the considerations that that lead lead to to the the solution Solution: A description of of the the general solution Consequences: Implications of of using the the pattern Implementation: Implementation details to to consider Java Java API API Usage: When available, an an example from from the the Java Java API API is is mentioned Code example: A code code example in in the the Java Java language Related patterns: A list list of of related patterns Charlie Abela CSA1019: Design Patterns 12

13 Design Pattern Categories The three main categories as as defined by the GOF book are: Creational patterns are are ones that create objects for for you, rather than having you instantiate objects directly. This gives programs more flexibility in in deciding which objects need to to be be created for for a given case. Structural patterns help in in composing groups of of objects into larger structures, such as as complex user interfaces or or accounting data. Behavioural patterns help define the the communication between objects in in the the system and how the the flow is is controlled in in a complex program. Charlie Abela CSA1019: Design Patterns 13

14 Design Patterns Considered The The following design patterns will will be be considered (following slides taken from from Design Patterns slides compiled by by Patrick Abela) Design Pattern Factory Method (Creational) Brief Description Creating different objects through subclassing of factory class. Abstract (Creational) Singleton (Creational) Adapter (Structural) Decorator (Structural) Factory Managing families of objects through interfaces Creating a single instance for the system Changing interfaces of an object Changing responsibilities of an object without subclassing Observer (Behavioural) Strategy (Behavioural) Varying number of objects that depend on another object. Changing algorithm of an object Charlie Abela CSA1019: Design Patterns 14

15 Creational Patterns Creational design patterns abstract the the instantiation process. Their aim aim is is that that of of helping make a system independent of of how how its its objects are are created, composed and and represented. These patterns give give flexibility in in what gets gets created, who who creates it, it, how howit it gets gets created, and and when. We We shall shall be be using an an example, building a maze for for a computer game, to to illustrate how how the the design of of the the system varies from from one one pattern to to another. We We shall shall be be focusing only only on on the the parts parts that that are are important for for creating a maze, ignoring other other details such such as as players, display operations and and position of of players. In In our our example a maze consists of of the the following: MazeComponent: Superclass for for all all components Room: Room: A class class which which has has reference to to four four doors/walls Door: Door: A class class which which has has reference to to two two rooms rooms (exit, (exit, entrance) Wall: Wall: A class class which which represents a a wall wall object object Maze: Maze: A class class that that represents a a collection of of Rooms Rooms MazeGame: A class class which which maintains references to to rooms rooms and and which which defines defines method method createmaze(). Charlie Abela CSA1019: Design Patterns 15

16 MazeGame Example MazeComponent enter() addroom() roomno() Maze rooms Room roomnumber enter() setside() getside() enter() Wall isopen enter() Door A maze is is a collection of of rooms Rooms, walls and and doors are are all all maze maze components A room maintains a reference to to other other maze components if if a player player is is in in a room room and and he he goes goes east, east, the the game game can can determine which which maze maze component is is immediately to to the the east east and and call call enter() enter() Charlie Abela CSA1019: Design Patterns 16

17 Creating a Maze Consider the the following createmaze() method :: Maze Maze m = new new Maze(); Room Room r1 r1 = new new Room(1); // // create room room 1 Room Room r2 r2 = new new Room Room (2); (2); // // create room room 2 Door Door d = new new Door Door (r1, (r1, r2); r2); r1.setside(north, new new Wall); r1.setside(east, d); d); r1.setside(south, new new Wall); r1.setside (West, new new Wall); r2.setside(north, new new Wall); r2.setside(east, d); d); r2.setside(south, new new Wall); r2.setside (West, new new Wall); m.addroom(r1); m.addroom(r2); The The problem with with this this method is is its its inflexibility the the maze layout is is hardcoded. Changing the the layout means changing this this method. The The creational patterns which we we are are going to to consider show ways ways of of how how to to make this this design more more flexible. Charlie Abela CSA1019: Design Patterns 17

18 Factory Method Design Pattern (Creational) Suppose we we wanted to to reuse an an existing maze layout for for a new new game containing enchanted components. The The new new game will will have have new new components such such as as DoorNeedingSpell (door can can be be locked and and opened with with a spell), RoomWithABomb and and BombedWall which are are subclasses of of Door, Room, Wall Wallrespectively. The The way way the the system has has been been designed does does not not allow us us to to recreate the the maze with with different components as as the the createmaze() method creates instances of of specific classes. To To handle this this issue issue we we can can make use use of of the the Factory Method design pattern. The The idea idea of of this this design pattern is is that that of of creating factory methods such such as as makeroom(), makewall() etc. etc. createmaze() creates components by by invoking these these methods rather then then by by using direct class class constructors The The MazeGame class class can can be be then then subclassed (overriding the the factory methods makeroom(), makewall() etc. etc. methods) to to create variations of of the the same same layout. Charlie Abela CSA1019: Design Patterns 18

19 Using Factory Method public class class MazeGame { public Maze Maze makemaze(){return new new Maze();} public Room Room makeroom( ){ return new new Room( );} public Wall Wall makewall() {return } } public Door Door makedoor() { } } public Maze Maze createmaze() { Maze Maze m = makemaze(); Room Room r1 r1 = makeroom(1); // // create room room 1 Room Room r2 r2 = makeroom(2); // // create room room 2 Door Door d = makedoor(r1, r2); r2); m.addroom(r1); m.addroom(r2); r1.setside(north, new new Wall); r1.setside(east, d); d); r1.setside(sourth, New New Wall); r1.setside (West, new new Wall); } To To create create the the same same Maze Maze with with RoomWithABomb, BombedWall, DoorNeedingSpell components, then then an an EnchantedMazeGame, subclass subclass of of MazeGame can can be be made made to to override override the the makeroom, makewall and and makedoor appropriately. Charlie Abela CSA1019: Design Patterns 19

20 Using Factory Method (cont) Consider this EnchantedMazeGame class: public class class EnchantedMazeGame extends MazeGame{ public Room Room makeroom(int n){ n){ return new new EnchantedRoom(n);} public Wall Wall makewall(){ return new new EnchantedWall();} public Door Door makedoor(room r1, r1, Room Room r2){ r2){ return new new EnchantedDoor(r1, r2);} r2);} } The createmaze() method of of MazeGame is is inherited by EnchantedMazeGame and can be used to to create regular mazes or or enchanted mazes without modification! Charlie Abela CSA1019: Design Patterns 20

21 Factory Method Structure The The structure section section of of the the Factory Factory Method Method design design pattern pattern defines defines the the structure of of the the design design pattern pattern as as follows: follows: (refer (refer to to book book for for more more details details on on pattern) pattern) Product defines defines the the interface of of objects objects the the factory factory method method creates creates ConcreteProduct implements the the Product Product interface Creator declares declares the the factory factory method method which which returns returns an an object object of of type type Product. Calls Calls also also the the factory factory method method to to create create a a Product Product object. object. ConcreteCreator- overrides the the factory factory method method to to return return an an instance instance of of a a ConcreteProduct. In In the the Maze Maze example :: Product corresponds to to MazeComponent interface ConcreteProduct corresponds to to Wall Wall Creator corresponds to to MazeGame class class ConcreteCreator corresponds to to EnchantedMaze. Charlie Abela CSA1019: Design Patterns 21

22 Abstract Factory Design Pattern (Creational) The Abstract Factory is is a more elaborate design pattern which builds on on the the Factory Method design pattern. One difference between the the two is is that with the the Abstract Factory pattern, a class delegates the the responsibility of of object instantiation to to another object via via composition whereas the the Factory Method pattern uses inheritance and relies on on a subclass to to handle the the desired object instantiation. The idea is is that of of defining interfaces for for the the factory and product classes which the the client accesses. The client (createmaze() in in the the example) would interact with the the factory through an an interface/abstract class which can be be implemented by by different factories. Moreover all all the the products (Wall, BombedWall etc.) generated through same method which is is implemented by by different factories, implement the the same interface or or extend the the same abstract class. Charlie Abela CSA1019: Design Patterns 22

23 Abstract Factory Design Pattern Generally the the Abstract Factory is is used used when: A system system should should be be independent of of how how its its products are are created, created, composed or or represented A system system should should be be configured with with one one of of multiple families families of of products A family family of of related related product product objects objects is is designed to to be be used used together together One One wants wants to to provide provide a a class class library library but but wants wants to to reveal reveal just just their their interfaces, not not their their implementation. Charlie Abela CSA1019: Design Patterns 23

24 Abstract Factory Example Applying the the Abstract Factory d.p. d.p. to to the the mazegame example: public abstract class class MazeFactory { public Maze Maze makemaze(); public Wall Wall makewall(); public Room Room makeroom(); public Door Door makedoor(); } Now Now the the createmaze() method of of the the MazeGame class class takes takes a MazeFactory reference as as a parameter: public class class MazeGame { public Maze Maze createmaze(mazefactory f){ f){ Maze Maze maze maze = f.makemaze(); Room Room r1 r1 = f.makeroom(1); Room Room r2 r2 = f.makeroom(2); Door Door door door = f.makedoor(r1, r2); r2); } maze.addroom(r1); maze.addroom(r2); r1.setside(north,f.makewall()); r1.setside(east,door); return maze; maze; Charlie Abela CSA1019: Design Patterns 24

25 Abstract Factory Example (cont) We can easily extend MazeFactory create other factories: to to public class class EnchantedMazeFactory extends MazeFactory{ public Room Room makeroom(int n){ n){ return new new EnchantedRoom(n);} public Wall Wall makewall(){ return new new EnchantedWall();} public Door Door makedoor(room r1, r1, Room Room r2){ r2){ return new new EnchantedDoor(r1, r2);} r2);} } Note that createmaze() can create components from EnchantedMazeFactory or or any implementation of of MazeFactory Charlie Abela CSA1019: Design Patterns 25

26 Abstract Factory Example (cont) Participants AbstractFactory: Declares an an interface for for operations that that create abstract product objects ConcreteFactory: Implements the the operations to to create concrete product objects AbstractProduct: Declares an an interface for for a type type of of product object ConcreteProduct: Defines a product object to to be be created by by the the corresponding concrete factory. Implements the the AbstractProduct interface Client: Uses Uses only only interfaces declared by by AbstractFactory and and AbstractProduct classes In In this example, the the correlations are: AbstractFactory => => MazeFactory ConcreteFactory => => EnchantedMazeFactory (MazeFactory is is also also a ConcreteFactory) AbstractProduct => => MazeComponent ConcreteProduct => => Wall, Wall, Room, Room, Door, Door, EnchantedWall,EnchantedRoom,Enchanted Door Door Client => => MazeGame Charlie Abela CSA1019: Design Patterns 26

27 Singleton Design Pattern (Creational) There exist circumstances when only one instance of of an an object can exist examples are are database connection pools, printer spoolers, window managers, file systems etc. The Singleton design pattern ensures that a class has only one instance. The idea is is that of of encapsulating an an instance of of a class within the the class itself. Any client which would like to to get get a reference to to an an instance invokes a static method of of the the class which returns a reference to to the the instance encapsulated within the the class. public class class Singleton{ private static Singleton instance = null; null; } protected Singleton(){ // // Exists only only to to defeat instantiation. } public static Singleton getinstance(){ if(instance == == null){ instance = new new Singleton(); } return instance; } Charlie Abela CSA1019: Design Patterns 27

28 Singleton Design Pattern Let us us say that there can be only one instance of of the MazeFactory class. public class class MazeFactory { private static MazeFactory m = new new MazeFactory() private MazeFactory(){} public static MazeFactory getinstance(){ return m;} m;} public Maze Maze makemaze() { } { } public Wall Wall makewall() { } } } } Charlie Abela CSA1019: Design Patterns 28

29 Adapter Design Pattern (Structural) Structural d.p. s are are concerned with with how how classes and and objects are are composed to to form form larger structures. The The Adapter d.p. d.p. is is a structural design pattern which is is used used when we we need need to to convert the the interface of of a class class into into another interface which the the client expects. Generally, we we could change the the class class to to conform to to the the required interface, however this this is is not not an an option if if we we do do not not have have the the source code. Even Even if if we we have have the the source code, sometimes it it is is not not practical to to adopt domain-specific interfaces to to have have the the class class integrate with with one one application. The The Adapter design pattern proposes two two different ways ways of of how how to to tackle this: this: By By inheritance (Class Adapter) Define an an adapter class class which subclasses the the given class class and and implements the the required interface By By composition (Object Adapter) The The adapter class class implements the the required interface and and maintains a reference to to an an instance of of the the class, delegating all all the the method invocations. Class adapters are are simpler than than object adapters in in that that they they involve fewer classes and and are are useful if if total total decoupling of of the the client and and Adaptee is is not not needed. Charlie Abela CSA1019: Design Patterns 29

30 Class Adapter Class adapters use use multiple inheritance to to achieve their their goals. The The class class adapter inherits the the interface of of the the client's target. However, it it also also inherits the the interface of of the the Adaptee as as well. well. Since Java Java does does not not support true true multiple inheritance, this this means that that one one of of the the interfaces must must be be inherited from from a Java Java Interface type. type. Note Note that that either or or both both of of the the Target or or Adaptee interfaces could be be a Java Java Interface. The The request to to the the target is is simply rerouted to to the the specific request that that was was inherited from from the the Adaptee interface. Charlie Abela CSA1019: Design Patterns 30

31 Object Adapter Object adapters use use a compositional technique to to adapt one one interface to to another. The The adapter inherits the the target interface that that the the client expects to to see, see, while it it holds an an instance to to the the Adaptee. When the the client calls calls the the request() method on on its its target object (the (the adapter), the the request is is translated into into the the corresponding specific request on on the the Adaptee. Object adapters enable the the client and and the the Adaptee to to be be completely decoupled from from each each other. Only Only the the adapter knows about both both of of them them Charlie Abela CSA1019: Design Patterns 31

32 Adapter Example Consider a drawing editor which manages graphical elements through a Shape Shapesuperclass. Graphical components such such as as PolygonShape, LineShape etc etc are are implemented as as subclasses of of Shape Shape Classes for for elementary geometric shapes are are easy easy to to implement, but but a TextShape subclass which allows for for text text editing could be be rather difficult to to implement -- hence we we might get get an an off-the-shelf TextView component. However this this component was was not not designed to to conform to to our our Shape Shapeinterface. Hence, we we define a TextShape adapter which adapts the the TextView interface to to Shape s. Target domain-specific interface used used by by client Client collaborates with with objects conforming to to Target Adaptee an an existing interface which needs adapting Adapter adapts the the interface of of Adaptee to to Target Charlie Abela CSA1019: Design Patterns 32

33 Adapter Example (cont) shape.request(); Editor Shape Shape: shape void request() void request(){ text.display(); } TextShapeAdapter TextView: text void request() TextView void display() Charlie Abela CSA1019: Design Patterns 33

34 Decorator Design Pattern (Structural) Sometimes it it is is the the case case that that we we want want to to add add responsibilities to to individual objects, rather than than to to an an entire class. A graphical user user interface toolkit, for for instance, should let let you you add add properties like like borders or or behaviour like like scrolling to to a graphical object Rather than than making our our component a subclass of of another class class which puts puts a border around every subclass instance (choice of of border is is static) we we make use use of of the the Decorator design pattern. The The Decorator d.p. d.p. defines a Decorator which conforms to to the the interface of of the the component it it decorates so so that that its its presence is is transparent to to the the component s clients. The The decorator wraps the the component and and forwards requests to to it it performing additional actions before or or after after forwarding. Transparency lets lets you you nest nest decorators recursively. The The Decorator d.p. d.p. varies from from the the Adapter d.p. d.p. in in that that a decorator only only changes an an object s responsibilities, not not its its interface; As As we we have have seen seen an an adapter gives an an object a completely new new interface. Charlie Abela CSA1019: Design Patterns 34

35 Decorator Design Pattern (cont) Motivation Applicability of of the the Decorator: To To add add responsibilities to to individual objects dynamically without affecting other other objects. When extension by by subclassing is is impractical. Sometimes a large large number of of independent extensions are are possible and and would produce an an explosion of of subclasses to to support every combination. Or Or a class class definition may may be be hidden or or otherwise unavailable for for subclassing. Charlie Abela CSA1019: Design Patterns 35

36 Decorator Design Pattern (cont) Charlie Abela CSA1019: Design Patterns 36

37 Decorator D.P. Example The The Structure for for the the Decorator d.p. d.p. includes: Component defines the the interface for for objects that that can can have have responsibilities added to to them them dynamically. ConcreteComponent defines an an object to to which additional responsibilities can can be be attached. Decorator maintains a reference to to a Component Object. ConcreteDecorator adds adds responsibilities to to the the component. Note Note that that Decorator and and all all of of its its subclasses inherit directly from from the the Component interface and and define same same set set of of operations as as Component Charlie Abela CSA1019: Design Patterns 37

38 Decorator D.P. Example The The java.io classes are are based over over this this design pattern. // // Open Open an an InputStream. FileInputStream in in = new new FileInputStream("test.dat"); // // Create a buffered InputStream. BufferedInputStream bin bin = new new BufferedInputStream(in); // // Create a buffered, LineNumerInputStream. LineNumberInputStream lnbin lnbin = new new LineNumberInputStream(bin); Text File for reading FileInputStream BufferedInputStream LineNumberInputStream Charlie Abela CSA1019: Design Patterns 38

39 Observer Design Pattern (Behavioural) The The Observer d.p. d.p. is is a behavioral pattern. Behavioral patterns are are concerned with with algorithms and and assignment of of responsibilities between objects. Behavioral patterns describe not not just just patterns of of objects or or classes but but also also patterns of of communication between them. The The Observer d.p. d.p. defines a one-to-many dependency between objects so so that that when one one object changes state, state, all all its its dependents are are notified and and updated automatically. The The need need for for such such a d.p. d.p. arises from from the the need need to to maintain consistency in in a system which is is partitioned into into a collection of of cooperating, non-tightly coupled, classes. The The key key objects in in this this pattern are are subject and and observer. A subject may may have have any any number of of independent observers. All All observers are are notified whenever the the subject undergoes a change in in state. state. In In Java Java this this design pattern is is used used by by GUI GUI components. Java Java defines events, listener interfaces, event throwing algorithms and and listener registration methods. Charlie Abela CSA1019: Design Patterns 39

40 Observer Design Pattern Motivation Charlie Abela CSA1019: Design Patterns 40

41 Observer D.P. Example The The Observer d.p. d.p. can can be be used used in in these these situations: When When a a change change to to one one object object requires requires changing others, others, (without knowing how how many many objects objects need need to to be be changed) When When an an object object should should be be able able to to notify notify other other objects objects without without making making assumptions about about who who these these objects objects are. are. In In the the diagram Subject Subject :: provides an an interface for for attaching and and detaching Observer objects objects Observer :: defines defines an an updating interface for for objects objects that that should should be be notified notified of of changes changes in in a a subject subject ConcreteSubject sends sends a a notification to to its its observers when when its its state state changes changes ConcreteObserver implements the the Observer updating interface to to keep keep its its state state consistent with with the the subject s. Each subject can have many observers <<Subject>> registerobserver() removeobserver() notifyobserver() observer update() <<Object>> notify each observer of subject's state change ConcreteSubject ConcreteObject registerobserver(){ } removeobserver() { } notifyobserver() { } subject update() { } update() obtains state information from the subject and acts on that state Charlie Abela CSA1019: Design Patterns 41

42 Observer D.P. Example (cont) A typical example of of the the use use of of the the Observer design pattern in in Java Java and and in in particular in in the the Swing API API A JButton has has AbstractButton as as its its superclass. This This has has a lot lot of of add/remove listener methods These These methods allow allow adding adding and and removing of of observers or or listeners public class class ObserverExample{ JFrame frame; public static void void main(string[] args){ ObserverExample ex ex = new new ObserverExample(); ex.go(); } public void void go(){ go(){ frame frame = new new JFrame(); JButton but but = new new JButton( Right or or Wrong? ); but.addactionlistener(new RightListener()); but.addactionlistener(new WrongListener());..... } Charlie Abela CSA1019: Design Patterns 42

43 Observer D.P. Example (cont) class class RightListener implements ActionListener{ public void void actionperformed(actionevent e){ e){ System.out.print( Don t do do it, it, it s it s wrong ); } } class class WrongListener implements ActionListener{ public void void actionperformed(actioneven e){ e){ System.out.print( Come on, on, do do it!! ); } } Charlie Abela CSA1019: Design Patterns 43

44 Strategy Design Pattern (Behavioural) The The Strategy design pattern allows a designer to to define a family of of algorithms and and make them them interchangeable within a class. The The idea idea is is that that of of encapsulating an an algorithm (called a strategy) in in such such a way way that that different implementations of of the the same same algorithm can can be be used. used. The The Strategy design pattern specifies two two interfaces The The Strategy (the (the encapsulation of of the the algorithm) defines defines an an interface which which gives gives abstracted access access to to the the algorithm. This This is is either either an an interface or or an an abstract abstract class class The The Context Context defines defines an an interface which which allows allows algorithm to to extract extract its its context. context. Charlie Abela CSA1019: Design Patterns 44

45 Strategy D.P. Example Situation: A class wants to to decide at at run-time what algorithm it it should use to to sort an an array. Many different sort algorithms are are already available. Solution: Encapsulate the the different sort algorithms using the the Strategy pattern. Charlie Abela CSA1019: Design Patterns 45

46 Strategy D.P. Example 2 Situation: A GUI GUI container object wants to to decide at at run-time what what strategy it it should use use to to layout the the GUI GUI components it it contains. Many different layout strategies are are already available. The The Java Java AWT adopts this this strategy for for its its LayoutManagers. Container <<LayoutManager>> FlowLayout BorderLayout CardLayout Charlie Abela CSA1019: Design Patterns 46

47 References Design Patterns, Elements of of Reusable Object-Oriented Software, by by Gamma, Helm, Johnson and Vlissides, Addison-Wesley, 1997 Head First Design Patterns, Eric Freeman, O Reilly, 2004 Practical UML Inheritance versus composition, Compo.pdf CMSC491D Design Patterns In In Java, by by Bob Tarr, Java Design Patterns at at a Glance, Java design patterns 101, introductory article by by David Gallardo, Charlie Abela CSA1019: Design Patterns 47

CHAPTER 8: USING OBJECTS

CHAPTER 8: USING OBJECTS Ruby: Philosophy & Implementation CHAPTER 8: USING OBJECTS Introduction to Computer Science Using Ruby Ruby is the latest in the family of Object Oriented Programming Languages As such, its designer studied

Læs mere

Black Jack --- Review. Spring 2012

Black Jack --- Review. Spring 2012 Black Jack --- Review Spring 2012 Simulation Simulation can solve real-world problems by modeling realworld processes to provide otherwise unobtainable information. Computer simulation is used to predict

Læs mere

Vina Nguyen HSSP July 13, 2008

Vina Nguyen HSSP July 13, 2008 Vina Nguyen HSSP July 13, 2008 1 What does it mean if sets A, B, C are a partition of set D? 2 How do you calculate P(A B) using the formula for conditional probability? 3 What is the difference between

Læs mere

IBM Network Station Manager. esuite 1.5 / NSM Integration. IBM Network Computer Division. tdc - 02/08/99 lotusnsm.prz Page 1

IBM Network Station Manager. esuite 1.5 / NSM Integration. IBM Network Computer Division. tdc - 02/08/99 lotusnsm.prz Page 1 IBM Network Station Manager esuite 1.5 / NSM Integration IBM Network Computer Division tdc - 02/08/99 lotusnsm.prz Page 1 New esuite Settings in NSM The Lotus esuite Workplace administration option is

Læs mere

Portal Registration. Check Junk Mail for activation . 1 Click the hyperlink to take you back to the portal to confirm your registration

Portal Registration. Check Junk Mail for activation  . 1 Click the hyperlink to take you back to the portal to confirm your registration Portal Registration Step 1 Provide the necessary information to create your user. Note: First Name, Last Name and Email have to match exactly to your profile in the Membership system. Step 2 Click on the

Læs mere

Privat-, statslig- eller regional institution m.v. Andet Added Bekaempelsesudfoerende: string No Label: Bekæmpelsesudførende

Privat-, statslig- eller regional institution m.v. Andet Added Bekaempelsesudfoerende: string No Label: Bekæmpelsesudførende Changes for Rottedatabasen Web Service The coming version of Rottedatabasen Web Service will have several changes some of them breaking for the exposed methods. These changes and the business logic behind

Læs mere

The X Factor. Målgruppe. Læringsmål. Introduktion til læreren klasse & ungdomsuddannelser Engelskundervisningen

The X Factor. Målgruppe. Læringsmål. Introduktion til læreren klasse & ungdomsuddannelser Engelskundervisningen The X Factor Målgruppe 7-10 klasse & ungdomsuddannelser Engelskundervisningen Læringsmål Eleven kan give sammenhængende fremstillinger på basis af indhentede informationer Eleven har viden om at søge og

Læs mere

PARALLELIZATION OF ATTILA SIMULATOR WITH OPENMP MIGUEL ÁNGEL MARTÍNEZ DEL AMOR MINIPROJECT OF TDT24 NTNU

PARALLELIZATION OF ATTILA SIMULATOR WITH OPENMP MIGUEL ÁNGEL MARTÍNEZ DEL AMOR MINIPROJECT OF TDT24 NTNU PARALLELIZATION OF ATTILA SIMULATOR WITH OPENMP MIGUEL ÁNGEL MARTÍNEZ DEL AMOR MINIPROJECT OF TDT24 NTNU OUTLINE INEFFICIENCY OF ATTILA WAYS TO PARALLELIZE LOW COMPATIBILITY IN THE COMPILATION A SOLUTION

Læs mere

Aktivering af Survey funktionalitet

Aktivering af Survey funktionalitet Surveys i REDCap REDCap gør det muligt at eksponere ét eller flere instrumenter som et survey (spørgeskema) som derefter kan udfyldes direkte af patienten eller forsøgspersonen over internettet. Dette

Læs mere

Project Step 7. Behavioral modeling of a dual ported register set. 1/8/ L11 Project Step 5 Copyright Joanne DeGroat, ECE, OSU 1

Project Step 7. Behavioral modeling of a dual ported register set. 1/8/ L11 Project Step 5 Copyright Joanne DeGroat, ECE, OSU 1 Project Step 7 Behavioral modeling of a dual ported register set. Copyright 2006 - Joanne DeGroat, ECE, OSU 1 The register set Register set specifications 16 dual ported registers each with 16- bit words

Læs mere

Basic statistics for experimental medical researchers

Basic statistics for experimental medical researchers Basic statistics for experimental medical researchers Sample size calculations September 15th 2016 Christian Pipper Department of public health (IFSV) Faculty of Health and Medicinal Science (SUND) E-mail:

Læs mere

Vores mange brugere på musskema.dk er rigtig gode til at komme med kvalificerede ønsker og behov.

Vores mange brugere på musskema.dk er rigtig gode til at komme med kvalificerede ønsker og behov. På dansk/in Danish: Aarhus d. 10. januar 2013/ the 10 th of January 2013 Kære alle Chefer i MUS-regi! Vores mange brugere på musskema.dk er rigtig gode til at komme med kvalificerede ønsker og behov. Og

Læs mere

Engelsk. Niveau C. De Merkantile Erhvervsuddannelser September 2005. Casebaseret eksamen. www.jysk.dk og www.jysk.com.

Engelsk. Niveau C. De Merkantile Erhvervsuddannelser September 2005. Casebaseret eksamen. www.jysk.dk og www.jysk.com. 052430_EngelskC 08/09/05 13:29 Side 1 De Merkantile Erhvervsuddannelser September 2005 Side 1 af 4 sider Casebaseret eksamen Engelsk Niveau C www.jysk.dk og www.jysk.com Indhold: Opgave 1 Presentation

Læs mere

GUIDE TIL BREVSKRIVNING

GUIDE TIL BREVSKRIVNING GUIDE TIL BREVSKRIVNING APPELBREVE Formålet med at skrive et appelbrev er at få modtageren til at overholde menneskerettighederne. Det er en god idé at lægge vægt på modtagerens forpligtelser over for

Læs mere

Engelsk. Niveau D. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

Engelsk. Niveau D. De Merkantile Erhvervsuddannelser September Casebaseret eksamen.  og 052431_EngelskD 08/09/05 13:29 Side 1 De Merkantile Erhvervsuddannelser September 2005 Side 1 af 4 sider Casebaseret eksamen Engelsk Niveau D www.jysk.dk og www.jysk.com Indhold: Opgave 1 Presentation

Læs mere

User Manual for LTC IGNOU

User Manual for LTC IGNOU User Manual for LTC IGNOU 1 LTC (Leave Travel Concession) Navigation: Portal Launch HCM Application Self Service LTC Self Service 1. LTC Advance/Intimation Navigation: Launch HCM Application Self Service

Læs mere

Generalized Probit Model in Design of Dose Finding Experiments. Yuehui Wu Valerii V. Fedorov RSU, GlaxoSmithKline, US

Generalized Probit Model in Design of Dose Finding Experiments. Yuehui Wu Valerii V. Fedorov RSU, GlaxoSmithKline, US Generalized Probit Model in Design of Dose Finding Experiments Yuehui Wu Valerii V. Fedorov RSU, GlaxoSmithKline, US Outline Motivation Generalized probit model Utility function Locally optimal designs

Læs mere

Userguide. NN Markedsdata. for. Microsoft Dynamics CRM 2011. v. 1.0

Userguide. NN Markedsdata. for. Microsoft Dynamics CRM 2011. v. 1.0 Userguide NN Markedsdata for Microsoft Dynamics CRM 2011 v. 1.0 NN Markedsdata www. Introduction Navne & Numre Web Services for Microsoft Dynamics CRM hereafter termed NN-DynCRM enable integration to Microsoft

Læs mere

Resource types R 1 1, R 2 2,..., R m CPU cycles, memory space, files, I/O devices Each resource type R i has W i instances.

Resource types R 1 1, R 2 2,..., R m CPU cycles, memory space, files, I/O devices Each resource type R i has W i instances. System Model Resource types R 1 1, R 2 2,..., R m CPU cycles, memory space, files, I/O devices Each resource type R i has W i instances. Each process utilizes a resource as follows: request use e.g., request

Læs mere

Brug sømbrættet til at lave sjove figurer. Lav fx: Få de andre til at gætte, hvad du har lavet. Use the nail board to make funny shapes.

Brug sømbrættet til at lave sjove figurer. Lav fx: Få de andre til at gætte, hvad du har lavet. Use the nail board to make funny shapes. Brug sømbrættet til at lave sjove figurer. Lav f: Et dannebrogsflag Et hus med tag, vinduer og dør En fugl En bil En blomst Få de andre til at gætte, hvad du har lavet. Use the nail board to make funn

Læs mere

Bilag. Resume. Side 1 af 12

Bilag. Resume. Side 1 af 12 Bilag Resume I denne opgave, lægges der fokus på unge og ensomhed gennem sociale medier. Vi har i denne opgave valgt at benytte Facebook som det sociale medie vi ligger fokus på, da det er det største

Læs mere

Appendix 1: Interview guide Maria og Kristian Lundgaard-Karlshøj, Ausumgaard

Appendix 1: Interview guide Maria og Kristian Lundgaard-Karlshøj, Ausumgaard Appendix 1: Interview guide Maria og Kristian Lundgaard-Karlshøj, Ausumgaard Fortæl om Ausumgaard s historie Der er hele tiden snak om værdier, men hvad er det for nogle værdier? uddyb forklar definer

Læs mere

Unitel EDI MT940 June 2010. Based on: SWIFT Standards - Category 9 MT940 Customer Statement Message (January 2004)

Unitel EDI MT940 June 2010. Based on: SWIFT Standards - Category 9 MT940 Customer Statement Message (January 2004) Unitel EDI MT940 June 2010 Based on: SWIFT Standards - Category 9 MT940 Customer Statement Message (January 2004) Contents 1. Introduction...3 2. General...3 3. Description of the MT940 message...3 3.1.

Læs mere

DK - Quick Text Translation. HEYYER Net Promoter System Magento extension

DK - Quick Text Translation. HEYYER Net Promoter System Magento extension DK - Quick Text Translation HEYYER Net Promoter System Magento extension Version 1.0 15-11-2013 HEYYER / Email Templates Invitation Email Template Invitation Email English Dansk Title Invitation Email

Læs mere

Shooting tethered med Canon EOS-D i Capture One Pro. Shooting tethered i Capture One Pro 6.4 & 7.0 på MAC OS-X 10.7.5 & 10.8

Shooting tethered med Canon EOS-D i Capture One Pro. Shooting tethered i Capture One Pro 6.4 & 7.0 på MAC OS-X 10.7.5 & 10.8 Shooting tethered med Canon EOS-D i Capture One Pro Shooting tethered i Capture One Pro 6.4 & 7.0 på MAC OS-X 10.7.5 & 10.8 For Canon EOS-D ejere der fotograferer Shooting tethered med EOS-Utility eller

Læs mere

E-PAD Bluetooth hængelås E-PAD Bluetooth padlock E-PAD Bluetooth Vorhängeschloss

E-PAD Bluetooth hængelås E-PAD Bluetooth padlock E-PAD Bluetooth Vorhängeschloss E-PAD Bluetooth hængelås E-PAD Bluetooth padlock E-PAD Bluetooth Vorhängeschloss Brugervejledning (side 2-6) Userguide (page 7-11) Bedienungsanleitung 1 - Hvordan forbinder du din E-PAD hængelås med din

Læs mere

DET KONGELIGE BIBLIOTEK NATIONALBIBLIOTEK OG KØBENHAVNS UNIVERSITETS- BIBLIOTEK. Index

DET KONGELIGE BIBLIOTEK NATIONALBIBLIOTEK OG KØBENHAVNS UNIVERSITETS- BIBLIOTEK. Index DET KONGELIGE Index Download driver... 2 Find the Windows 7 version.... 2 Download the Windows Vista driver.... 4 Extract driver... 5 Windows Vista installation of a printer.... 7 Side 1 af 12 DET KONGELIGE

Læs mere

ATEX direktivet. Vedligeholdelse af ATEX certifikater mv. Steen Christensen stec@teknologisk.dk www.atexdirektivet.

ATEX direktivet. Vedligeholdelse af ATEX certifikater mv. Steen Christensen stec@teknologisk.dk www.atexdirektivet. ATEX direktivet Vedligeholdelse af ATEX certifikater mv. Steen Christensen stec@teknologisk.dk www.atexdirektivet.dk tlf: 7220 2693 Vedligeholdelse af Certifikater / tekniske dossier / overensstemmelseserklæringen.

Læs mere

NOTIFICATION. - An expression of care

NOTIFICATION. - An expression of care NOTIFICATION - An expression of care Professionals who work with children and young people have a special responsibility to ensure that children who show signs of failure to thrive get the wright help.

Læs mere

how to save excel as pdf

how to save excel as pdf 1 how to save excel as pdf This guide will show you how to save your Excel workbook as PDF files. Before you do so, you may want to copy several sheets from several documents into one document. To do so,

Læs mere

Linear Programming ١ C H A P T E R 2

Linear Programming ١ C H A P T E R 2 Linear Programming ١ C H A P T E R 2 Problem Formulation Problem formulation or modeling is the process of translating a verbal statement of a problem into a mathematical statement. The Guidelines of formulation

Læs mere

Our activities. Dry sales market. The assortment

Our activities. Dry sales market. The assortment First we like to start to introduce our activities. Kébol B.V., based in the heart of the bulb district since 1989, specialises in importing and exporting bulbs world-wide. Bulbs suitable for dry sale,

Læs mere

Observation Processes:

Observation Processes: Observation Processes: Preparing for lesson observations, Observing lessons Providing formative feedback Gerry Davies Faculty of Education Preparing for Observation: Task 1 How can we help student-teachers

Læs mere

Den nye Eurocode EC Geotenikerdagen Morten S. Rasmussen

Den nye Eurocode EC Geotenikerdagen Morten S. Rasmussen Den nye Eurocode EC1997-1 Geotenikerdagen Morten S. Rasmussen UDFORDRINGER VED EC 1997-1 HVAD SKAL VI RUNDE - OPBYGNINGEN AF DE NYE EUROCODES - DE STØRSTE UDFORDRINGER - ER DER NOGET POSITIVT? 2 OPBYGNING

Læs mere

Overblik Program 17. nov

Overblik Program 17. nov Overblik Program 17. nov Oplæg, diskussion og sketchnoting af artikler Pencils before pixels, Drawing as... og Learning as reflective conversation... Intro til markers Øvelser: Formundersøgelser & idegenerering

Læs mere

Skriftlig Eksamen Kombinatorik, Sandsynlighed og Randomiserede Algoritmer (DM528)

Skriftlig Eksamen Kombinatorik, Sandsynlighed og Randomiserede Algoritmer (DM528) Skriftlig Eksamen Kombinatorik, Sandsynlighed og Randomiserede Algoritmer (DM58) Institut for Matematik og Datalogi Syddansk Universitet, Odense Torsdag den 1. januar 01 kl. 9 13 Alle sædvanlige hjælpemidler

Læs mere

Remember the Ship, Additional Work

Remember the Ship, Additional Work 51 (104) Remember the Ship, Additional Work Remember the Ship Crosswords Across 3 A prejudiced person who is intolerant of any opinions differing from his own (5) 4 Another word for language (6) 6 The

Læs mere

Titel: Hungry - Fedtbjerget

Titel: Hungry - Fedtbjerget Titel: Hungry - Fedtbjerget Tema: fedme, kærlighed, relationer Fag: Engelsk Målgruppe: 8.-10.kl. Data om læremidlet: Tv-udsendelse: TV0000006275 25 min. DR Undervisning 29-01-2001 Denne pædagogiske vejledning

Læs mere

ECE 551: Digital System * Design & Synthesis Lecture Set 5

ECE 551: Digital System * Design & Synthesis Lecture Set 5 ECE 551: Digital System * Design & Synthesis Lecture Set 5 5.1: Verilog Behavioral Model for Finite State Machines (FSMs) 5.2: Verilog Simulation I/O and 2001 Standard (In Separate File) 3/4/2003 1 ECE

Læs mere

SOFTWARE PROCESSES. Dorte, Ida, Janne, Nikolaj, Alexander og Erla

SOFTWARE PROCESSES. Dorte, Ida, Janne, Nikolaj, Alexander og Erla SOFTWARE PROCESSES Dorte, Ida, Janne, Nikolaj, Alexander og Erla Hvad er en software proces? Et struktureret sæt af AKTIVITETER, hvis mål er udvikling af software. En software proces model er en abstrakt

Læs mere

An expression of care Notification. Engelsk

An expression of care Notification. Engelsk An expression of care Notification Engelsk Kolding Kommune Senior- og Socialforvaltningen, Familierådgivningen Professionals who work with children and young have a special responsibility to ensure that

Læs mere

1 What is the connection between Lee Harvey Oswald and Russia? Write down three facts from his file.

1 What is the connection between Lee Harvey Oswald and Russia? Write down three facts from his file. Lee Harvey Oswald 1 Lee Harvey Oswald s profile Read Oswald s profile. Answer the questions. 1 What is the connection between Lee Harvey Oswald and Russia? Write down three facts from his file. 2 Oswald

Læs mere

IBM Software Group. SOA v akciji. Srečko Janjić WebSphere Business Integration technical presales IBM Software Group, CEMA / SEA IBM Corporation

IBM Software Group. SOA v akciji. Srečko Janjić WebSphere Business Integration technical presales IBM Software Group, CEMA / SEA IBM Corporation IBM Software Group SOA v akciji Srečko Janjić Business Integration technical presales IBM Software Group, CEMA / SEA Service Oriented Architecture Design principles and technology for building reusable,

Læs mere

Skriftlig Eksamen Beregnelighed (DM517)

Skriftlig Eksamen Beregnelighed (DM517) Skriftlig Eksamen Beregnelighed (DM517) Institut for Matematik & Datalogi Syddansk Universitet Mandag den 7 Januar 2008, kl. 9 13 Alle sædvanlige hjælpemidler (lærebøger, notater etc.) samt brug af lommeregner

Læs mere

MSE PRESENTATION 2. Presented by Srunokshi.Kaniyur.Prema. Neelakantan Major Professor Dr. Torben Amtoft

MSE PRESENTATION 2. Presented by Srunokshi.Kaniyur.Prema. Neelakantan Major Professor Dr. Torben Amtoft CAPABILITY CONTROL LIST MSE PRESENTATION 2 Presented by Srunokshi.Kaniyur.Prema. Neelakantan Major Professor Dr. Torben Amtoft PRESENTATION OUTLINE Action items from phase 1 presentation tti Architecture

Læs mere

Richter 2013 Presentation Mentor: Professor Evans Philosophy Department Taylor Henderson May 31, 2013

Richter 2013 Presentation Mentor: Professor Evans Philosophy Department Taylor Henderson May 31, 2013 Richter 2013 Presentation Mentor: Professor Evans Philosophy Department Taylor Henderson May 31, 2013 OVERVIEW I m working with Professor Evans in the Philosophy Department on his own edition of W.E.B.

Læs mere

Åbenrå Orienteringsklub

Åbenrå Orienteringsklub Åbenrå Orienteringsklub Velkommen til det ægte orienteringsløb på Blå Sommer 2009 Din gruppe har tilmeldt spejdere til at deltage i det ægte orienteringsløb på Blå Sommer 2009. Orienteringsløbet gennemføres

Læs mere

On the complexity of drawing trees nicely: corrigendum

On the complexity of drawing trees nicely: corrigendum Acta Informatica 40, 603 607 (2004) Digital Object Identifier (DOI) 10.1007/s00236-004-0138-y On the complexity of drawing trees nicely: corrigendum Thorsten Akkerman, Christoph Buchheim, Michael Jünger,

Læs mere

Det er muligt at chekce følgende opg. i CodeJudge: og

Det er muligt at chekce følgende opg. i CodeJudge: og Det er muligt at chekce følgende opg. i CodeJudge:.1.7 og.1.14 Exercise 1: Skriv en forløkke, som producerer følgende output: 1 4 9 16 5 36 Bonusopgave: Modificer dit program, så det ikke benytter multiplikation.

Læs mere

Molio specifications, development and challenges. ICIS DA 2019 Portland, Kim Streuli, Molio,

Molio specifications, development and challenges. ICIS DA 2019 Portland, Kim Streuli, Molio, Molio specifications, development and challenges ICIS DA 2019 Portland, Kim Streuli, Molio, 2019-06-04 Introduction The current structure is challenged by different factors. These are for example : Complex

Læs mere

How Long Is an Hour? Family Note HOME LINK 8 2

How Long Is an Hour? Family Note HOME LINK 8 2 8 2 How Long Is an Hour? The concept of passing time is difficult for young children. Hours, minutes, and seconds are confusing; children usually do not have a good sense of how long each time interval

Læs mere

Status på det trådløse netværk

Status på det trådløse netværk Status på det trådløse netværk Der er stadig problemer med det trådløse netværk, se status her: http://driftstatus.sdu.dk/?f=&antal=200&driftid=1671#1671 IT-service arbejder stadig med at løse problemerne

Læs mere

CS 4390/5387 SOFTWARE V&V LECTURE 5 BLACK-BOX TESTING - 2

CS 4390/5387 SOFTWARE V&V LECTURE 5 BLACK-BOX TESTING - 2 1 CS 4390/5387 SOFTWARE V&V LECTURE 5 BLACK-BOX TESTING - 2 Outline 2 HW Solution Exercise (Equivalence Class Testing) Exercise (Decision Table Testing) Pairwise Testing Exercise (Pairwise Testing) 1 Homework

Læs mere

LESSON NOTES Extensive Reading in Danish for Intermediate Learners #8 How to Interview

LESSON NOTES Extensive Reading in Danish for Intermediate Learners #8 How to Interview LESSON NOTES Extensive Reading in Danish for Intermediate Learners #8 How to Interview CONTENTS 2 Danish 5 English # 8 COPYRIGHT 2019 INNOVATIVE LANGUAGE LEARNING. ALL RIGHTS RESERVED. DANISH 1. SÅDAN

Læs mere

Skriftlig Eksamen Beregnelighed (DM517)

Skriftlig Eksamen Beregnelighed (DM517) Skriftlig Eksamen Beregnelighed (DM517) Institut for Matematik & Datalogi Syddansk Universitet Mandag den 31 Oktober 2011, kl. 9 13 Alle sædvanlige hjælpemidler (lærebøger, notater etc.) samt brug af lommeregner

Læs mere

Trolling Master Bornholm 2015

Trolling Master Bornholm 2015 Trolling Master Bornholm 2015 (English version further down) Panorama billede fra starten den første dag i 2014 Michael Koldtoft fra Trolling Centrum har brugt lidt tid på at arbejde med billederne fra

Læs mere

IPv6 Application Trial Services. 2003/08/07 Tomohide Nagashima Japan Telecom Co., Ltd.

IPv6 Application Trial Services. 2003/08/07 Tomohide Nagashima Japan Telecom Co., Ltd. IPv6 Application Trial Services 2003/08/07 Tomohide Nagashima Japan Telecom Co., Ltd. Outline Our Trial Service & Technology Details Activity & Future Plan 2 Outline Our Trial Service & Technology Details

Læs mere

F o r t o l k n i n g e r a f m a n d a l a e r i G I M - t e r a p i

F o r t o l k n i n g e r a f m a n d a l a e r i G I M - t e r a p i F o r t o l k n i n g e r a f m a n d a l a e r i G I M - t e r a p i - To fortolkningsmodeller undersøgt og sammenlignet ifm. et casestudium S i g r i d H a l l b e r g Institut for kommunikation Aalborg

Læs mere

RoE timestamp and presentation time in past

RoE timestamp and presentation time in past RoE timestamp and presentation time in past Jouni Korhonen Broadcom Ltd. 5/26/2016 9 June 2016 IEEE 1904 Access Networks Working Group, Hørsholm, Denmark 1 Background RoE 2:24:6 timestamp was recently

Læs mere

Skriftlig Eksamen Diskret matematik med anvendelser (DM72)

Skriftlig Eksamen Diskret matematik med anvendelser (DM72) Skriftlig Eksamen Diskret matematik med anvendelser (DM72) Institut for Matematik & Datalogi Syddansk Universitet, Odense Onsdag den 18. januar 2006 Alle sædvanlige hjælpemidler (lærebøger, notater etc.),

Læs mere

Trolling Master Bornholm 2014

Trolling Master Bornholm 2014 Trolling Master Bornholm 2014 (English version further down) Den ny havn i Tejn Havn Bornholms Regionskommune er gået i gang med at udvide Tejn Havn, og det er med til at gøre det muligt, at vi kan være

Læs mere

Titel: Barry s Bespoke Bakery

Titel: Barry s Bespoke Bakery Titel: Tema: Kærlighed, kager, relationer Fag: Engelsk Målgruppe: 8.-10.kl. Data om læremidlet: Tv-udsendelse: SVT2, 03-08-2014, 10 min. Denne pædagogiske vejledning indeholder ideer til arbejdet med tema

Læs mere

Terese B. Thomsen 1.semester Formidling, projektarbejde og webdesign ITU DMD d. 02/11-2012

Terese B. Thomsen 1.semester Formidling, projektarbejde og webdesign ITU DMD d. 02/11-2012 Server side Programming Wedesign Forelæsning #8 Recap PHP 1. Development Concept Design Coding Testing 2. Social Media Sharing, Images, Videos, Location etc Integrates with your websites 3. Widgets extend

Læs mere

Help / Hjælp

Help / Hjælp Home page Lisa & Petur www.lisapetur.dk Help / Hjælp Help / Hjælp General The purpose of our Homepage is to allow external access to pictures and videos taken/made by the Gunnarsson family. The Association

Læs mere

PMDK PC-Side Basic Function Reference (Version 1.0)

PMDK PC-Side Basic Function Reference (Version 1.0) PMDK PC-Side Basic Function Reference (Version 1.0) http://www.icpdas.com PMDK PC-Side Basic Function Reference V 1.0 1 Warranty All products manufactured by ICPDAS Inc. are warranted against defective

Læs mere

Design til digitale kommunikationsplatforme-f2013

Design til digitale kommunikationsplatforme-f2013 E-travellbook Design til digitale kommunikationsplatforme-f2013 ITU 22.05.2013 Dreamers Lana Grunwald - svetlana.grunwald@gmail.com Iya Murash-Millo - iyam@itu.dk Hiwa Mansurbeg - hiwm@itu.dk Jørgen K.

Læs mere

Improving data services by creating a question database. Nanna Floor Clausen Danish Data Archives

Improving data services by creating a question database. Nanna Floor Clausen Danish Data Archives Improving data services by creating a question database Nanna Floor Clausen Danish Data Archives Background Pressure on the students Decrease in response rates The users want more Why a question database?

Læs mere

The GAssist Pittsburgh Learning Classifier System. Dr. J. Bacardit, N. Krasnogor G53BIO - Bioinformatics

The GAssist Pittsburgh Learning Classifier System. Dr. J. Bacardit, N. Krasnogor G53BIO - Bioinformatics The GAssist Pittsburgh Learning Classifier System Dr. J. Bacardit, N. Krasnogor G53BIO - Outline bioinformatics Summary and future directions Objectives of GAssist GAssist [Bacardit, 04] is a Pittsburgh

Læs mere

Bemærk, der er tale om ældre versioner af softwaren, men fremgangsmåden er uændret.

Bemærk, der er tale om ældre versioner af softwaren, men fremgangsmåden er uændret. Check dine svar på: https://dtu.codejudge.net/02101-e18/ Exercise 1: Installer Eclipse og Java. Dette kan f.eks. gøres ved at følge instuktionerne i dokumentet eclipse intro.pdf som ligger under Fildeling

Læs mere

Fejlbeskeder i SMDB. Business Rules Fejlbesked Kommentar. Validate Business Rules. Request- ValidateRequestRegist ration (Rules :1)

Fejlbeskeder i SMDB. Business Rules Fejlbesked Kommentar. Validate Business Rules. Request- ValidateRequestRegist ration (Rules :1) Fejlbeskeder i SMDB Validate Business Rules Request- ValidateRequestRegist ration (Rules :1) Business Rules Fejlbesked Kommentar the municipality must have no more than one Kontaktforløb at a time Fejl

Læs mere

The River Underground, Additional Work

The River Underground, Additional Work 39 (104) The River Underground, Additional Work The River Underground Crosswords Across 1 Another word for "hard to cope with", "unendurable", "insufferable" (10) 5 Another word for "think", "believe",

Læs mere

Titel Stutterer. Data om læremidlet: Tv-udsendelse 1: Stutterer Kortfilm SVT 2, , 14 minutter

Titel Stutterer. Data om læremidlet: Tv-udsendelse 1: Stutterer Kortfilm SVT 2, , 14 minutter Pædagogisk vejledning Titel Stutterer Tema: kærlighed Fag: Engelsk Målgruppe: 8.-10.kl. QR-koden fører til posten i mitcfu Data om læremidlet: Tv-udsendelse 1: Stutterer Kortfilm SVT 2, 11-09-2016, 14

Læs mere

Handout 1: Eksamensspørgsmål

Handout 1: Eksamensspørgsmål Handout 1: Eksamensspørgsmål Denne vejledning er udfærdiget på grundlag af Peter Bakkers vejledning til jeres eksamensspørgsmål. Hvis der skulle forekomme afvigelser fra Peter Bakkers vejledning, er det

Læs mere

Sport for the elderly

Sport for the elderly Sport for the elderly - Teenagers of the future Play the Game 2013 Aarhus, 29 October 2013 Ditte Toft Danish Institute for Sports Studies +45 3266 1037 ditte.toft@idan.dk A growing group in the population

Læs mere

Financial Literacy among 5-7 years old children

Financial Literacy among 5-7 years old children Financial Literacy among 5-7 years old children -based on a market research survey among the parents in Denmark, Sweden, Norway, Finland, Northern Ireland and Republic of Ireland Page 1 Purpose of the

Læs mere

Barnets navn: Børnehave: Kommune: Barnets modersmål (kan være mere end et)

Barnets navn: Børnehave: Kommune: Barnets modersmål (kan være mere end et) Forældreskema Barnets navn: Børnehave: Kommune: Barnets modersmål (kan være mere end et) Barnets alder: år og måneder Barnet begyndte at lære dansk da det var år Søg at besvare disse spørgsmål så godt

Læs mere

Business Opening. Very formal, recipient has a special title that must be used in place of their name

Business Opening. Very formal, recipient has a special title that must be used in place of their name - Opening English Danish Dear Mr. President, Kære Hr. Direktør, Very formal, recipient has a special title that must be used in place of their name Dear Sir, Formal, male recipient, name unknown Dear Madam,

Læs mere

Hvor er mine runde hjørner?

Hvor er mine runde hjørner? Hvor er mine runde hjørner? Ofte møder vi fortvivlelse blandt kunder, når de ser deres nye flotte site i deres browser og indser, at det ser anderledes ud, i forhold til det design, de godkendte i starten

Læs mere

Statistik for MPH: 7

Statistik for MPH: 7 Statistik for MPH: 7 3. november 2011 www.biostat.ku.dk/~pka/mph11 Attributable risk, bestemmelse af stikprøvestørrelse (Silva: 333-365, 381-383) Per Kragh Andersen 1 Fra den 6. uges statistikundervisning:

Læs mere

Business Opening. Very formal, recipient has a special title that must be used in place of their name

Business Opening. Very formal, recipient has a special title that must be used in place of their name - Opening Danish English Kære Hr. Direktør, Dear Mr. President, Very formal, recipient has a special title that must be used in place of their name Kære Hr., Formal, male recipient, name unknown Kære Fru.,

Læs mere

2a. Conceptual Modeling Methods

2a. Conceptual Modeling Methods ICT Enhanced Buildings Potentials IKT og Videnrepræsentationer - ICT and Knowledge Representations. 2a. Conceptual Modeling Methods Cand. Scient. Bygningsinformatik. Semester 2, 2010. CONTENT Conceptual

Læs mere

Trolling Master Bornholm 2014

Trolling Master Bornholm 2014 Trolling Master Bornholm 2014 (English version further down) Ny præmie Trolling Master Bornholm fylder 10 år næste gang. Det betyder, at vi har fundet på en ny og ganske anderledes præmie. Den fisker,

Læs mere

Byg din informationsarkitektur ud fra en velafprøvet forståelsesramme The Open Group Architecture Framework (TOGAF)

Byg din informationsarkitektur ud fra en velafprøvet forståelsesramme The Open Group Architecture Framework (TOGAF) Byg din informationsarkitektur ud fra en velafprøvet forståelsesramme The Open Group Framework (TOGAF) Otto Madsen Director of Enterprise Agenda TOGAF og informationsarkitektur på 30 min 1. Introduktion

Læs mere

Online kursus: Content Mangement System - Wordpress

Online kursus: Content Mangement System - Wordpress Online kursus 365 dage DKK 1.999 Nr. 90213 P ekskl. moms Wordpress er et open-source content management system, som anvendes af mere end 23% af verdens 10 millioner mest besøgte hjemmesider. Det er et

Læs mere

Software 1 with Java. Recitation No. 7 (Servlets, Inheritance)

Software 1 with Java. Recitation No. 7 (Servlets, Inheritance) Software 1 with Java Recitation No. 7 (Servlets, Inheritance) Servlets Java modules that run on a Web server to answer client requests For example: Processing data submitted by a browser Providing dynamic

Læs mere

Boligsøgning / Search for accommodation!

Boligsøgning / Search for accommodation! Boligsøgning / Search for accommodation! For at guide dig frem til den rigtige vejledning, skal du lige svare på et par spørgsmål: To make sure you are using the correct guide for applying you must answer

Læs mere

Skriftlig Eksamen Automatteori og Beregnelighed (DM17)

Skriftlig Eksamen Automatteori og Beregnelighed (DM17) Skriftlig Eksamen Automatteori og Beregnelighed (DM17) Institut for Matematik & Datalogi Syddansk Universitet Odense Campus Lørdag, den 15. Januar 2005 Alle sædvanlige hjælpemidler (lærebøger, notater

Læs mere

Nyhedsmail, december 2013 (scroll down for English version)

Nyhedsmail, december 2013 (scroll down for English version) Nyhedsmail, december 2013 (scroll down for English version) Kære Omdeler Julen venter rundt om hjørnet. Og netop julen er årsagen til, at NORDJYSKE Distributions mange omdelere har ekstra travlt med at

Læs mere

Constant Terminal Voltage. Industry Workshop 1 st November 2013

Constant Terminal Voltage. Industry Workshop 1 st November 2013 Constant Terminal Voltage Industry Workshop 1 st November 2013 Covering; Reactive Power & Voltage Requirements for Synchronous Generators and how the requirements are delivered Other countries - A different

Læs mere

Curve Modeling B-Spline Curves. Dr. S.M. Malaek. Assistant: M. Younesi

Curve Modeling B-Spline Curves. Dr. S.M. Malaek. Assistant: M. Younesi Curve Modeling B-Spline Curves Dr. S.M. Malaek Assistant: M. Younesi Motivation B-Spline Basis: Motivation Consider designing the profile of a vase. The left figure below is a Bézier curve of degree 11;

Læs mere

Mandara. PebbleCreek. Tradition Series. 1,884 sq. ft robson.com. Exterior Design A. Exterior Design B.

Mandara. PebbleCreek. Tradition Series. 1,884 sq. ft robson.com. Exterior Design A. Exterior Design B. Mandara 1,884 sq. ft. Tradition Series Exterior Design A Exterior Design B Exterior Design C Exterior Design D 623.935.6700 robson.com Tradition OPTIONS Series Exterior Design A w/opt. Golf Cart Garage

Læs mere

Forslag til implementering af ResearcherID og ORCID på SCIENCE

Forslag til implementering af ResearcherID og ORCID på SCIENCE SCIENCE Forskningsdokumentation Forslag til implementering af ResearcherID og ORCID på SCIENCE SFU 12.03.14 Forslag til implementering af ResearcherID og ORCID på SCIENCE Hvad er WoS s ResearcherID? Hvad

Læs mere

DSB s egen rejse med ny DSB App. Rubathas Thirumathyam Principal Architect Mobile

DSB s egen rejse med ny DSB App. Rubathas Thirumathyam Principal Architect Mobile DSB s egen rejse med ny DSB App Rubathas Thirumathyam Principal Architect Mobile Marts 2018 AGENDA 1. Ny App? Ny Silo? 2. Kunden => Kunderne i centrum 1 Ny app? Ny silo? 3 Mødetitel Velkommen til Danske

Læs mere

Business Rules Fejlbesked Kommentar

Business Rules Fejlbesked Kommentar Fejlbeskeder i SMDB Validate Business Request- ValidateRequestRegi stration ( :1) Business Fejlbesked Kommentar the municipality must have no more than one Kontaktforløb at a time Fejl 1: Anmodning En

Læs mere

Dean's Challenge 16.november 2016

Dean's Challenge 16.november 2016 O Dean's Challenge 16.november 2016 The pitch proces..with or without slides Create and Practice a Convincing pitch Support it with Slides (if allowed) We help entrepreneurs create, train and improve their

Læs mere

Applications. Computational Linguistics: Jordan Boyd-Graber University of Maryland RL FOR MACHINE TRANSLATION. Slides adapted from Phillip Koehn

Applications. Computational Linguistics: Jordan Boyd-Graber University of Maryland RL FOR MACHINE TRANSLATION. Slides adapted from Phillip Koehn Applications Slides adapted from Phillip Koehn Computational Linguistics: Jordan Boyd-Graber University of Maryland RL FOR MACHINE TRANSLATION Computational Linguistics: Jordan Boyd-Graber UMD Applications

Læs mere

StarWars-videointro. Start din video på den nørdede måde! Version: August 2012

StarWars-videointro. Start din video på den nørdede måde! Version: August 2012 StarWars-videointro Start din video på den nørdede måde! Version: August 2012 Indholdsfortegnelse StarWars-effekt til videointro!...4 Hent programmet...4 Indtast din tekst...5 Export til film...6 Avanceret

Læs mere

Fejlbeskeder i Stofmisbrugsdatabasen (SMDB)

Fejlbeskeder i Stofmisbrugsdatabasen (SMDB) Fejlbeskeder i Stofmisbrugsdatabasen (SMDB) Oversigt over fejlbeskeder (efter fejlnummer) ved indberetning til SMDB via webløsning og via webservices (hvor der dog kan være yderligere typer fejlbeskeder).

Læs mere

X M Y. What is mediation? Mediation analysis an introduction. Definition

X M Y. What is mediation? Mediation analysis an introduction. Definition What is mediation? an introduction Ulla Hvidtfeldt Section of Social Medicine - Investigate underlying mechanisms of an association Opening the black box - Strengthen/support the main effect hypothesis

Læs mere

Central Statistical Agency.

Central Statistical Agency. Central Statistical Agency www.csa.gov.et 1 Outline Introduction Characteristics of Construction Aim of the Survey Methodology Result Conclusion 2 Introduction Meaning of Construction Construction may

Læs mere