You're about to create your best presentation ever

Business Oriented Design Templates With Powerpoint

Create your presentation by reusing a template from our community or transition your PowerPoint deck into a visually compelling Prezi presentation.

Data Oriented Design

Transcript: 2019 - Giorgio Testa, Nicola Palomba Data Oriented Design Or "Why OOP is not always the best choice" Data Oriented Design Intro A different program design paradigm Born due to the videogame industry needs Dictionary English Italian Niche Contiguous Branch Rendering Theoretically Habit Nicchia (inteso di prodotto poco diffuso) Contiguo (immediatamente vicino) Ramo, ramificazione, diramazione Processo con il quale un motore grafico mostra degli ogetti su uno schermo Teoricamente, in teoria Abitudine A bit of history A little bit of videogames history At the beginning they were niche products Firstly made in C Introduction of GPUs, game industry evolution Diffusion of object oriented programming Establishment of C++ as main language for game making Niche: di nicchia OOD Problems OOD problems They are mostly due to: Bad cache usage Bad memory access Branches What are branches? If / else Can't be prefetched Often cause a cache miss Branch: ramo, ramificazione, diramazione Memory access (Bad) memory access Objects are (usually) not stored contiguously Accessing values often causes a cache miss Setting values often causes a cache miss Contiguous: immediatamente vicino Threads Thread management in OOP Threads need synchronization Synchronization creates branches There are usually dependencies between threads Virtual functions Virtual functions are bad They use vtables They create branches They need extra instructions to work Basic concepts of DOD Basis of DOD Avoid branches Know your data Save your data OOD DOD Rendering: processo con il quale un motore grafico "disegna" degli oggetti sullo schermo They are independent No need for synchronization Fewer branches Cleaner threads Threads with DOD SIMD: Single Instruction, Multiple Data Implemented with data vectorization Better optimization for CPU and GPU SIMD compatibility SIMD compatibility Data Oriented Design implementation How to implement DOD Data grouping Grouping data The OOD way The DOD way Array of structures Structure of arrays Data tables Tables as data containers INPUT TABLE OUTPUT TABLE Evaluation No direct modifications, no direct output AVOID BRANCHES! How can we avoid branches? Think about your algorithms Create extra data tables Know data structures DOD advantages Pros Speed increase High scalability High scalability Adding threads doesn't cause any problems Adding fields just creates new, independent arrays Having a solid base helps expanding a system Better testing Testing a Data Oriented system is easier Input and output are easily analyzable A Data Oriented program is linear Threads are independent Easier editing Modifying a data oriented program is easier Changes are isolated Changes theoretically affect max 2 functions Theoretically: in teoria, teoricamente DOD disadvantages Cons Grouping data is hard Avoiding branches is hard Languages are not your friends It's hard to give up your old habits Habits: abitudini Should you stop using OOP? Results No! Sometimes you have no choice Small objects are fine Structures are fine You're probably not writing games or NASA software Videogames Search algorithms DataBases Every field in which a huge amount of data is involved DOD applications Applications

Object-Oriented Design

Transcript: Generalization and inheritance An object-oriented design process Objects are abstractions of real-world or system entities and manage themselves. Objects are independent and encapsulate state and representation information. System functionality is expressed in terms of object services. Shared data areas are eliminated. Objects communicate by message passing. Objects may be distributed and may execute sequentially or in parallel. Changes required Use-case models UML associations •Objects and object classes •Object-Oriented Design and Process •Design evolution Weather station interface Subsystems in the weather mapping system Interacting Object Design evolution Design models Sequence models Concurrent objects Active objects •Objects are implemented as parallel processes and the internal object state may be changed by the object itself and not simply by external calls. Object identification Servers. The object is implemented as a parallel process (server) with entry points corresponding to object operations. If no calls are made to it, the object suspends itself and waits for further requests for service. Objects and object classes participate in relationships with other objects and object classes. In the UML, a generalized relationship is indicated by an association. Associations may be annotated with information that describes the association. Associations are general but may indicate that an attribute of an object is an associated object or that a method relies on an associated object. The Unified Modeling Language provides different notations for defining different object models. A range of different models may be produced during an object-oriented design process. These include static and dynamic system models. Object interfaces should be defined precisely using e.g. a programming language like Java. Object-oriented design potentially simplifies system evolution. A weather mapping system is required to generate weather maps on a regular basis using data collected from remote, unattended weather stations and other data sources such as weather observers, balloons and satellites. Weather stations transmit their data to the area computer in response to a request from that machine. The area computer system validates the collected data and integrates it with the data from different sources. The integrated data is archived and, using data from this archive and a digitized map database a set of local weather maps is created. Maps may be printed for distribution on a special-purpose map printer or may be displayed in a number of different formats. Architectural design Advantages of inheritance Object communication Data collection sequence It is an abstraction mechanism which may be used to classify entities. It is a reuse mechanism at both the design and the programming level. The inheritance graph is a source of organizational knowledge about domains and systems. Examples of design models // Call a method associated with a buffer // object that returns the next value // in the buffer v = circularBuffer.Get () ; // Call the method associated with a // thermostat object that sets the // temperature to be maintained thermostat.setTemp (20) ; Once interactions between the system and its environment have been understood, you use this information for designing the system architecture. A layered architecture as discussed in Chapter 11 is appropriate for the weather station Interface layer for handling communications; Data collection layer for managing instruments; Instruments layer for collecting data. There should normally be no more than 7 entities in an architectural model. Servers and active objects Show how objects respond to different service requests and the state transitions triggered by these requests If object state is Shutdown then it responds to a Startup () message; In the waiting state the object is waiting for further messages; If reportWeather () then system moves to summarizing state;oIf calibrate () the system moves to a calibrating state; A collecting state is entered when a clock signal is received. Further objects and object refinement •Objects are entities in a software system which represent instances of real-world and system entities. •Object classes are templates for objects. They may be used to create objects. •Object classes may inherit attributes and services from other object classes. •The nature of objects as self-contained entities make them suitable for concurrent implementation. •The message-passing model of object communication can be implemented directly if objects are running on separate processors in a distributed system. Weather station object classes Topics covered Objectives Sub-system models that show logical groupings of objects into coherent subsystems. Sequence models that show the sequence of object interactions. State machine models that show how individual objects change their state in response to events. Other models include use-case models, aggregation models,

Systems oriented design

Transcript: METHODS, CONCEPTS and TECHNIQUES developed by and for: Everybody is encouraged to make the systems oriented design true or false? own approach patterns of interactions seeks richness How to understand and grasp the Incubation Techniques are techniques used by the designer in order to acquire the background knowledge needed for an incubation process to take place. Risk analysis GIGA-mapping S.O.D. captures Incubation Techniques simple method for developing GIGA-maps and to find potential areas for interventions and innovations ? better or worse. complexity Virtual digital design space Be able to quickly get a picture of the field. finally developed process. system thinkers ARE: to system thinking! GLOBALISATION systematizing and interrelating the information and knowledge obtained solutions are rather By paying attention to the richness of the design space, the design space can become a very efficient tool to maintain an overview of the complexity of the project all the way. SUSTAINABILITY traditional problem-solving: and The rich design space visual thinking using... using the approach of: the designers ability to think in COMPLEX SYSTEMS needs to be trained and developed further! S.O.D unique methods and concepts PROCESS Instead of hierarchy, borders, modeling, feedback loops... whole fields of relations TOOL FOR BOTH: Etnographic studies used to wicked problems designers and Zoom, Innovation, Potential SUPERCOMPLEX? developed by and for: influencing decisions concerning industrial production ARE: Interacting elements and more complex problems Combined with methods and techniques from other disciplines create your own interpretation and implementation of systems thinking Physical space also trained in: trained in creative thinking and idea generation look beyond the object! rather than simplification of the complex systems. not & also trained in: COULD BE: This is COMMUNICATING IDEAS Creatively and intuitively find synergistic solutions. Scenario thinking Nothing is irrelevant Nothing is uninteresting Strive for information richness Cheap and accessible media Just do it Don’t talk too much — write and draw Facilitate, don’t dominate Activate existing knowledge Defy filters and schemata Avoid hierarchy Don’t brainstorm Messy is good Mix it up Use timelines Never start with the start Look for relations Create relations Collaborate Switch media Display, don’t hide Design early Design and redesign Don’t over-design Analyse Be critical ZIP-Analysis

Object- Oriented Design

Transcript: Attributes have private access, meaning being hidden from external objects. Only special public operations, known as accessors and mutators should allow external objects to access the values in attributes. Chapter 11 An Intro to Object- Oriented Design Chapter 11 *calling deposit(), and has passed these ^ parameters. This will deposit the amount and return newBalance. The statements above also assign default values to their attributes and methods. When a new object uses an existing method from its class it is written as followed- *Objects name followed by the method, seperated by a period. The chequeAccount is an object that has called the method displayBalance() Constructors are prewritten methods that have the same name as their class, once they are called, the constructor will create an object, and assign initial values. In some cases, the method may also return a value to the caller, a message to a chequeAccount object requesting deposit services can be called as followed: chequeAccount.displayBalance() Objectives Objects, Classes, Attributes, Methods, Inheritance. Class Diagrams End 3. Develop a test or driver algorithm to test the solution. Instantiating objects *Inside parenthesis can be attributes sedan.accelerate() hatchback.accelerate() In Object- Oriented Design the program requires classes, attributes, and methods to be represented in a class Diagram, which is similar to a defining diagram. Accessors, Mutators, Messages Keyword 'new' refers to a new object, once instantiated as a new class, it will inherit the same attributes as the class, it will always be upper case. 1. Identify the objects and their attributes, responsibilities and operations. Private access means that the attributes and methods are invisible to the rest of the system. Public access is visible to the rest of the system. All attributes should be private! Private(-), Public(+). Attributes(characteristics) on the top, methods(actions) on the bottom. It does not describe how or when the operations are to be performed. 11.1 Introduction to object-oriented design. A mutator enables external values to be passed to attributes. They start with the word 'set', in other words, it sets the value of an attribute. Public and Private access methods DisplayBalance(), deposit(), and withdraw() are all visible to the user, calculateinterest() and verifySufficientFunds() are needed for the public methods to be operated. These private methods are only visible in the BankAccount class, not externally visible. Accessor operations pass attributes to external objects, but do not change the values. They start with the word 'get', in other words it gets the value of an attribute. A message is a call made by one object to an operation in another object, it can be written as followed: There are 3 steps in creating an object-oriented solution for a problem with just one class: An object in this design can be compared to a milk jug, where it can perform, such as filling and pouring, the jug has a handle which can be considered a user-friendly interface. In object-oriented program, the jug is known as an object and the operations it does is called methods. A class is used to describe a group of objects that share some common properties. For example a milk jug, juice jug, and water jug share common properties, in other words are a class. The process of creating objects from classes is called instantiation, many objects can be instantiated from a class. Attributes are the set of properties or characteristics that describe a particular object. Methods are a set of operations which are performed on an object. Inheritance allows a new object to inherit the same attributes and methods as an existing object. Object- Oriented Design To Introduce object-oriented design. To define objects, classes, attributes, operations, and information hiding. To introduce public and private operations, accessors, and mutators. To list the steps required to create an object-oriented solution to a problem. Objects must be created in object-oriented programs, every time an object is instantiated from a class, a special operation or set of instructions, known as a 'constructor' method is called or invoked. 2. Design the algorithms for the operations or methods, using structured design. Creating an object-oriented solution Example- Create sedan as new Car() Object-oriented programming uses the same concepts as procedural programming, however focuses on the objects that make up the program rather than the processes. An object-oriented design asks that you interact with the problem in much the same way that your interact with the world, treating the problem as a set of separate objects that relate to each other. An object-oriented program is a set of interacting objects, each one responsible for its own activities and data. chequeAccount.deposit(amount, newBalance) Format of Instantiation- Create object-name as new Class-name()

Now you can make any subject more engaging and memorable