itle: Glorp Tutorial
Speaker: Niall Ross
Mon, August 18, 2:00pm – 3:30pm
Video Part1: https://www.youtube.com/watch?v=cPN1A4WQyiA
Video Part2: https://www.youtube.com/watch?v=25S6cSYgh34
Abstract:
The target audience for this hands-on tutorial is those with little or no Glorp experience (but more experienced people willing to pair-program with beginners are most welcome). The tutorial will help them to start using in Glorp in their own applications.
Participants will create a simple Glorp descriptor system for a domain model. They will generate a database from it, incorporating some existing legacy. They will write and read between the database and their domain model using Glorp commands. The issues of transactions, caching and refreshing will be addressed.
This document provides an overview of the Migrate module in Drupal for importing content from external data sources. It discusses key concepts like sources, destinations, maps, and field mappings. Sources can include SQL, CSV, XML and JSON. Destinations are typically entities like nodes and users. Maps connect source IDs to destination IDs. Field mappings link source and destination fields. The document also covers migrations, field handlers, and the prepareRow(), prepare(), and complete() methods.
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...Doug Jones
We rarely dive into current programming languages, touting the next new framework or the new features that will be out next year. This is about JavaScript the language as it exists today, what I picked up in going from C# to JS, and what C# picked up from JS along the way as well. It is based on Douglas Crockford's seminal book "JavaScript: The Good Parts".
The document discusses XML and methods for working with XML nodes in .NET. It provides an example of programmatically creating an XML node by first creating element, attribute, and document objects, appending the attribute to the element, appending the element to the root node, and saving the XML file. It also shows how to select and retrieve values from existing XML nodes to populate object properties.
Advanced Scala reflection & runtime meta-programming. The Scala compiler toolbox. Reading Scala Annotations and overcoming type erasure with some real world use cases.
This document provides an agenda and overview of a presentation on JavaScript. It introduces JavaScript, covering its history, cores, uses today, and programming paradigms. It then discusses object-oriented JavaScript, data types and structures, and control statements in JavaScript. The document also mentions functions, prototypes, and JSON before concluding with examples of libraries and frameworks that could be used in a demo program.
This document discusses attributes and reflection in C#. It begins by explaining what attributes are and how they can be used to associate declarative metadata with code entities. It then provides examples of using predefined attributes like Obsolete. It discusses user-defined attributes and the AttributeUsage attribute. It covers conditional methods and the Conditional attribute. The document explains reflection and how the Type class is central to it. It provides examples of using reflection to identify types that implement an interface or are subclasses of a given type. It concludes with a test case that gets the constructors of the String class using reflection.
Objects in JavaScript can be created using object literals, the new keyword, or Object.create(). Objects are collections of properties and methods that are mutable and manipulated by reference. Arrays are objects that represent ordered collections of values of any type and are created using array literals or the Array constructor. Common array methods include concat, join, pop, push, reverse, and sort. The Math object provides common mathematical functions like pow, round, ceil, floor, random, and trigonometric functions.
This document provides an overview of the Migrate module in Drupal for importing content from external data sources. It discusses key concepts like sources, destinations, maps, and field mappings. Sources can include SQL, CSV, XML and JSON. Destinations are typically entities like nodes and users. Maps connect source IDs to destination IDs. Field mappings link source and destination fields. The document also covers migrations, field handlers, and the prepareRow(), prepare(), and complete() methods.
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...Doug Jones
We rarely dive into current programming languages, touting the next new framework or the new features that will be out next year. This is about JavaScript the language as it exists today, what I picked up in going from C# to JS, and what C# picked up from JS along the way as well. It is based on Douglas Crockford's seminal book "JavaScript: The Good Parts".
The document discusses XML and methods for working with XML nodes in .NET. It provides an example of programmatically creating an XML node by first creating element, attribute, and document objects, appending the attribute to the element, appending the element to the root node, and saving the XML file. It also shows how to select and retrieve values from existing XML nodes to populate object properties.
Advanced Scala reflection & runtime meta-programming. The Scala compiler toolbox. Reading Scala Annotations and overcoming type erasure with some real world use cases.
This document provides an agenda and overview of a presentation on JavaScript. It introduces JavaScript, covering its history, cores, uses today, and programming paradigms. It then discusses object-oriented JavaScript, data types and structures, and control statements in JavaScript. The document also mentions functions, prototypes, and JSON before concluding with examples of libraries and frameworks that could be used in a demo program.
This document discusses attributes and reflection in C#. It begins by explaining what attributes are and how they can be used to associate declarative metadata with code entities. It then provides examples of using predefined attributes like Obsolete. It discusses user-defined attributes and the AttributeUsage attribute. It covers conditional methods and the Conditional attribute. The document explains reflection and how the Type class is central to it. It provides examples of using reflection to identify types that implement an interface or are subclasses of a given type. It concludes with a test case that gets the constructors of the String class using reflection.
Objects in JavaScript can be created using object literals, the new keyword, or Object.create(). Objects are collections of properties and methods that are mutable and manipulated by reference. Arrays are objects that represent ordered collections of values of any type and are created using array literals or the Array constructor. Common array methods include concat, join, pop, push, reverse, and sort. The Math object provides common mathematical functions like pow, round, ceil, floor, random, and trigonometric functions.
This document provides an introduction to JavaScript, covering basic concepts like data types, variables, operators, conditionals, loops, functions, arrays, and objects. It explains that JavaScript is an interpreted language that allows dynamic and interactive functionality on websites. Key points are demonstrated through examples, like using alert to output "Hello World" and basic math operations with variables.
The document discusses PXB (Perl XML Binding), a module that generates Perl API classes from XML schemas, allowing XML documents to be easily mapped to and from Perl data structures. It outlines the motivations for PXB, describes its data model and how the API is built, and discusses features like SQL mapping, logging, and testing. Problems encountered include dependency failures and performance issues that are being addressed through optimizations and alternative parsing approaches.
This document discusses using the Drupal database API to interact with the database in Drupal. It covers the basics of db_query and dynamic queries using db_select. It discusses how to add conditions, joins, sorting, and other clauses to dynamic queries. It also covers how to work with result sets and how to perform inserts, updates, and deletes using the API. Finally, it discusses when to use the database API versus views and provides a case study comparing the two approaches.
JavaScript is the world's most popular programming language. It is used to add interactive effects to web pages. JavaScript code can be inserted into HTML pages between <script> tags. Common JavaScript statements include conditional statements like if/else and loops. Variables are used to store and manipulate data in JavaScript. Common data types include strings, numbers, booleans, arrays, and objects. Functions allow code reuse and organization. Operators are used to assign values, compare values, and perform arithmetic. jQuery is a popular JavaScript library that simplifies DOM manipulation and event handling.
Solid and Sustainable Development in Scalascalaconfjp
Kazuhiro Sera introduced several of his Scala projects including ScalikeJDBC, Skinny Framework, and AWScala. He discussed some of his philosophies for solid and sustainable development in Scala including using simplified class-based OOP with immutable data structures, avoiding overkill abstraction, writing tests without question, keeping infrastructure lightweight, and ensuring projects have no surprises for newcomers. He welcomed questions during the upcoming AMA session.
JavaScript String:
The String object lets you work with a series of characters; it wraps Javascript's string primitive data type with a number of helper methods.
As JavaScript automatically converts between string primitives and String objects, you can call any of the helper methods of the String object on a string primitive.
JavaScript Arrays:
The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
JavaScript - Chapter 4 - Types and StatementsWebStackAcademy
A computer program is a list of "instructions" to be "executed" by a computer.
In a programming language, these programming instructions are called statements.
A JavaScript program is a list of programming statements.
JavaScript statements are composed of:
Values, Operators, Expressions, Keywords, and Comments.
This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":
JavaScript Data Types
JavaScript variables can hold many data types: numbers, strings, objects and more.
In programming, data types is an important concept.
To be able to operate on variables, it is important to know something about the type.
JavaScript is a scripting language used primarily for client-side web development. It is based on the ECMAScript standard but browsers support additional objects like Window and DOM objects. JavaScript can be used to create dynamic and interactive effects on web pages like menus, alerts, and updating content without reloading. It is commonly used for form validation, AJAX applications, and other interactive features. The document provides examples of basic JavaScript concepts like variables, data types, operators, and control structures and how to embed scripts in HTML.
Generally speaking, a function is a "subprogram" that can be called by code external (or internal in the case of recursion) to the function. Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function will return a value.
In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object. What distinguishes them from other objects is that functions can be called. In brief, they are Function objects.
This document provides an introduction to JavaScript and its uses for web programming. It explains that JavaScript is a client-side scripting language that allows web pages to become interactive. Some key points covered include:
- JavaScript can change HTML content, styles, validate data, and make calculations.
- Functions are blocks of code that perform tasks when invoked by events or called in code.
- Events like clicks or keyboard presses trigger JavaScript code.
- The DOM (Document Object Model) represents an HTML document that JavaScript can access and modify.
- Forms and user input can be accessed and processed using the DOM.
- Programming flow can be controlled with conditional and loop statements.
-
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
The document discusses Object Relational Mapping (ORM) in Django. It begins by explaining that ORM provides an API that allows accessing databases in an object-oriented style, making the database more transparent. It then provides examples of how to define models by inheriting from Django's Model class and adding fields. Various field types like CharField, IntegerField, DateField are demonstrated. It also shows how to define relationships and primary keys. The document concludes by explaining how to perform CRUD operations on models in an object-oriented way using Django's ORM APIs.
DBIx-DataModel is an object-relational mapping framework for Perl5. Schema declarations are inspired from UML modelling. The API provides efficient interaction with the DBI layer, detailed control on statement execution steps, flexible and powerful treatment of database joins. More on http://search.cpan.org/dist/DBIx-DataModel.
Talk presented at YAPC::EU::2011 Riga (updated from a previous version presented at FPW2010).
This document summarizes an ORM architecture talk given by Alex Gaynor. It discusses the major components of Django's ORM, including managers, querysets, queries, and SQL compilers. It provides examples of custom aggregates and automatic single object caching using the ORM. The talk focused on 50% ORM architecture details and 50% practical applications of the ORM.
It contains basic fundamental of class, object, method overloading, constructor, destructor, visibility, acess specifier, Methods, overloading, clonning of objects etc. are covered here.
Kindly look at it and give your comments to improve it as good as possible ways.
The JavaScript programming language is a multi-paradigm language that is misunderstood due to its name, design errors in early implementations, and use in web browsers. It is a functional language that uses objects, prototypes, and closures. Values in JavaScript include numbers, strings, Booleans, objects, null, and undefined. All other values are objects.
The document discusses JavaScript and some of its key features:
- JavaScript is the programming language of the web browser and was originally developed by Netscape under different names before being standardized.
- JavaScript uses a prototypal object model instead of classes, with objects inheriting directly from other objects via prototypal inheritance chains rather than from classes.
- The "new" keyword is used to create objects but can give the misleading impression of classes; functions can also be used to create objects without "new" by returning the object.
JavaScript is an interpreted programming language that is used for client-side scripting in web browsers. It was originally developed by Brendan Eich at Netscape under the name Mocha and later LiveScript, before being standardized as ECMAScript. JavaScript can be used for client-side development in areas like jQuery, and server-side development with Node.js. It is a prototype-based, multi-paradigm scripting language that is dynamic, weak typed, and supports object-oriented, imperative, and declarative programming styles.
This document discusses using the Glorp object relational mapping framework in Smalltalk. Glorp sits between objects and database tables, mapping classes to tables. It provides a flexible yet easy to use way to connect objects and databases. The document demonstrates creating a simple descriptor system to map a LogItem class and table in Glorp. It also discusses tools like the ObjectStudio mapping tool and Active Record patterns that can automate descriptor creation when objects or databases change.
This document discusses Glorp, an object-relational mapping framework for Smalltalk, and compares it to ActiveRecord in Ruby on Rails. It summarizes Glorp's approach to reading a database schema, generating mappings dynamically based on conventions and constraints, and integrating with web frameworks like Magritte. The document also discusses issues like subselects, aggregations, and correlated subqueries that Glorp addresses to provide ActiveRecord-like functionality while maintaining flexibility.
This document provides an introduction to JavaScript, covering basic concepts like data types, variables, operators, conditionals, loops, functions, arrays, and objects. It explains that JavaScript is an interpreted language that allows dynamic and interactive functionality on websites. Key points are demonstrated through examples, like using alert to output "Hello World" and basic math operations with variables.
The document discusses PXB (Perl XML Binding), a module that generates Perl API classes from XML schemas, allowing XML documents to be easily mapped to and from Perl data structures. It outlines the motivations for PXB, describes its data model and how the API is built, and discusses features like SQL mapping, logging, and testing. Problems encountered include dependency failures and performance issues that are being addressed through optimizations and alternative parsing approaches.
This document discusses using the Drupal database API to interact with the database in Drupal. It covers the basics of db_query and dynamic queries using db_select. It discusses how to add conditions, joins, sorting, and other clauses to dynamic queries. It also covers how to work with result sets and how to perform inserts, updates, and deletes using the API. Finally, it discusses when to use the database API versus views and provides a case study comparing the two approaches.
JavaScript is the world's most popular programming language. It is used to add interactive effects to web pages. JavaScript code can be inserted into HTML pages between <script> tags. Common JavaScript statements include conditional statements like if/else and loops. Variables are used to store and manipulate data in JavaScript. Common data types include strings, numbers, booleans, arrays, and objects. Functions allow code reuse and organization. Operators are used to assign values, compare values, and perform arithmetic. jQuery is a popular JavaScript library that simplifies DOM manipulation and event handling.
Solid and Sustainable Development in Scalascalaconfjp
Kazuhiro Sera introduced several of his Scala projects including ScalikeJDBC, Skinny Framework, and AWScala. He discussed some of his philosophies for solid and sustainable development in Scala including using simplified class-based OOP with immutable data structures, avoiding overkill abstraction, writing tests without question, keeping infrastructure lightweight, and ensuring projects have no surprises for newcomers. He welcomed questions during the upcoming AMA session.
JavaScript String:
The String object lets you work with a series of characters; it wraps Javascript's string primitive data type with a number of helper methods.
As JavaScript automatically converts between string primitives and String objects, you can call any of the helper methods of the String object on a string primitive.
JavaScript Arrays:
The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
JavaScript - Chapter 4 - Types and StatementsWebStackAcademy
A computer program is a list of "instructions" to be "executed" by a computer.
In a programming language, these programming instructions are called statements.
A JavaScript program is a list of programming statements.
JavaScript statements are composed of:
Values, Operators, Expressions, Keywords, and Comments.
This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":
JavaScript Data Types
JavaScript variables can hold many data types: numbers, strings, objects and more.
In programming, data types is an important concept.
To be able to operate on variables, it is important to know something about the type.
JavaScript is a scripting language used primarily for client-side web development. It is based on the ECMAScript standard but browsers support additional objects like Window and DOM objects. JavaScript can be used to create dynamic and interactive effects on web pages like menus, alerts, and updating content without reloading. It is commonly used for form validation, AJAX applications, and other interactive features. The document provides examples of basic JavaScript concepts like variables, data types, operators, and control structures and how to embed scripts in HTML.
Generally speaking, a function is a "subprogram" that can be called by code external (or internal in the case of recursion) to the function. Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function will return a value.
In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object. What distinguishes them from other objects is that functions can be called. In brief, they are Function objects.
This document provides an introduction to JavaScript and its uses for web programming. It explains that JavaScript is a client-side scripting language that allows web pages to become interactive. Some key points covered include:
- JavaScript can change HTML content, styles, validate data, and make calculations.
- Functions are blocks of code that perform tasks when invoked by events or called in code.
- Events like clicks or keyboard presses trigger JavaScript code.
- The DOM (Document Object Model) represents an HTML document that JavaScript can access and modify.
- Forms and user input can be accessed and processed using the DOM.
- Programming flow can be controlled with conditional and loop statements.
-
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
The document discusses Object Relational Mapping (ORM) in Django. It begins by explaining that ORM provides an API that allows accessing databases in an object-oriented style, making the database more transparent. It then provides examples of how to define models by inheriting from Django's Model class and adding fields. Various field types like CharField, IntegerField, DateField are demonstrated. It also shows how to define relationships and primary keys. The document concludes by explaining how to perform CRUD operations on models in an object-oriented way using Django's ORM APIs.
DBIx-DataModel is an object-relational mapping framework for Perl5. Schema declarations are inspired from UML modelling. The API provides efficient interaction with the DBI layer, detailed control on statement execution steps, flexible and powerful treatment of database joins. More on http://search.cpan.org/dist/DBIx-DataModel.
Talk presented at YAPC::EU::2011 Riga (updated from a previous version presented at FPW2010).
This document summarizes an ORM architecture talk given by Alex Gaynor. It discusses the major components of Django's ORM, including managers, querysets, queries, and SQL compilers. It provides examples of custom aggregates and automatic single object caching using the ORM. The talk focused on 50% ORM architecture details and 50% practical applications of the ORM.
It contains basic fundamental of class, object, method overloading, constructor, destructor, visibility, acess specifier, Methods, overloading, clonning of objects etc. are covered here.
Kindly look at it and give your comments to improve it as good as possible ways.
The JavaScript programming language is a multi-paradigm language that is misunderstood due to its name, design errors in early implementations, and use in web browsers. It is a functional language that uses objects, prototypes, and closures. Values in JavaScript include numbers, strings, Booleans, objects, null, and undefined. All other values are objects.
The document discusses JavaScript and some of its key features:
- JavaScript is the programming language of the web browser and was originally developed by Netscape under different names before being standardized.
- JavaScript uses a prototypal object model instead of classes, with objects inheriting directly from other objects via prototypal inheritance chains rather than from classes.
- The "new" keyword is used to create objects but can give the misleading impression of classes; functions can also be used to create objects without "new" by returning the object.
JavaScript is an interpreted programming language that is used for client-side scripting in web browsers. It was originally developed by Brendan Eich at Netscape under the name Mocha and later LiveScript, before being standardized as ECMAScript. JavaScript can be used for client-side development in areas like jQuery, and server-side development with Node.js. It is a prototype-based, multi-paradigm scripting language that is dynamic, weak typed, and supports object-oriented, imperative, and declarative programming styles.
This document discusses using the Glorp object relational mapping framework in Smalltalk. Glorp sits between objects and database tables, mapping classes to tables. It provides a flexible yet easy to use way to connect objects and databases. The document demonstrates creating a simple descriptor system to map a LogItem class and table in Glorp. It also discusses tools like the ObjectStudio mapping tool and Active Record patterns that can automate descriptor creation when objects or databases change.
This document discusses Glorp, an object-relational mapping framework for Smalltalk, and compares it to ActiveRecord in Ruby on Rails. It summarizes Glorp's approach to reading a database schema, generating mappings dynamically based on conventions and constraints, and integrating with web frameworks like Magritte. The document also discusses issues like subselects, aggregations, and correlated subqueries that Glorp addresses to provide ActiveRecord-like functionality while maintaining flexibility.
A Weak Pharo Story
Video: https://youtu.be/nLEmAVVC6aQ
Thu, August 25, 3:00pm – 3:15pm
Description
Automatic garbage collection, used to free unused objects, generally provides a finalization mechanism that allows developers to execute some arbitrary code when an object was or is about to be garbage collected. This finalization mechanism, useful to free external resources, is implemented in Pharo through the usage of special weak references and a weak registry. While this finalization process was in place and working since several years, with the increase of the complexity of the Pharo IDE it demonstrated to not be sufficient. In this talk we will show some popular misconceptions of the idea of "weak" references, and how memory leaks can be (and were) created from these misconceptions. We will also show how to avoid and solve this problem, ending up in the introduction of Ephemerons in latest Pharo 6.
Bio: Guille Polito is research engineer at CNRS, France. Pharoer since 2010, he participates actively in the Pharo open source community since several years. He currently works on the modularization of Pharo where he does software archeology, refactoring, library rewriting and participates in the Virtual Machine development.
GemStone is a privately owned company with 100 employees that provides object database products including GemStone/S, Facets, GemFire, and GemFire Real Time Events. They are developing GemStone/64 to provide a 64-bit version of GemStone/S to improve performance and scalability over the 32-bit version. GemStone/64 will be released in phases, with Phase 1 (Ashland) addressing performance, Phase 2 (Bend) addressing scalability, and Phase 3 (Corvallis) addressing tuning. Ashland 1.0 has been released and provides significant performance improvements over GemStone 6.1.
This document describes the current process for diagnosing blood cancers and the requirements for a new web application to improve the process. Currently, samples are sent to different specialized labs that use separate IT systems, which causes delays and errors when the initial diagnosis is wrong. The new web application will allow clinicians to enter initial diagnoses and sample data, which will then be distributed to the various lab systems. It will also aggregate results and allow multidisciplinary teams to track samples and results. The development process involves mapping the existing lab database schemas, modeling the data, and refactoring some classes and descriptors to link the new and existing systems together.
This document provides an overview of Store and Glorp. Store is a version control system for Cincom Smalltalk that uses a relational database as a repository. It versions bundles, packages, classes, methods, and other entities. Glorp is an object-relational mapping framework that Store now uses instead of hand-coded SQL. This provides benefits like easier querying and administration. The document discusses how Store objects work with Glorp sessions and queries. It also covers opportunities, issues from migrating to Glorp like speed improvements, and planned enhancements for Store in version 7.9.
This document provides an introduction and overview of MongoTalk and Voyage, two Smalltalk libraries for interacting with MongoDB databases. It demonstrates how to install, configure, and perform basic operations like creating databases and collections, inserting, updating, deleting and querying documents with both libraries. It also shows how to customize mappings and relationships when using Voyage.
This document summarizes the GLORP (Generic Lightweight Object-Relational Persistence) library, an open-source library for object-relational mapping. It discusses GLORP's motivations, including supporting schema changes for a critical application with a complex data model. Key features highlighted are GLORP's declarative mappings, optimized queries, automatic transaction handling, and object-level rollback support. The document also covers GLORP's licensing under the LGPL and acknowledges its contributors.
Tugrik: A new persistence option for Pharo
Wed, August 24, 2:00pm – 2:45pm
youtube: https://youtu.be/YwlUdRaqTwE
First Name: Dale
Last Name: Henrichs
Email: dhenrich@gemtalksystems.com
Title: Tugrik: A new persistence option for Pharo
Type: Talk
Abstract:
Tugrik[1] is a new persistence framework for Pharo using GemStone/S 64[3] as
the data base engine.
"GemStone/S 64 provides a distributed, server-based,
multi-user, transactional Smalltalk runtime system,
with the ability to partition the application
between client and server"[4]
As of this writing, a proof of concept for Tugrik has been implemented using
a MongoTalk-style[2] API. The proof of concept includes a Voyage[5]
implementation for Tugrik.
While it is somewhat interesting for developers to use Tugrik to simply
replace MongoDb in their Pharo applications, the work moving forward will
focus on expanding the functionality of Tugrik beyond that of a simple
document database, after all, GemStone/S is a fully functional Smalltalk
implementation.
This talk will describe the proof of concept and discuss the current state
of the project.
[1] https://github.com/dalehenrich/Tugrik
[2] https://github.com/pharo-nosql/mongotalk
[3] https://gemtalksystems.com/products/gs64/
[4] https://downloads.gemtalksystems.com/docs/GemStone64/3.3.x/GS64-ProgGuide-3.3/GS64-ProgGuide-3.3.htm
[5] https://github.com/dalehenrich/voyage
Bio:
Dale Henrichs is a Principal Engineer at GemTalk Systems and has been working
in Smalltalk since 1985. For the last decade Dale has focused on the development
and support of open source projects for both GemTalk Systems and the Smalltalk
community. His contributions to the Smalltalk community include Metacello,
FileTree, and the GemStone port of Seaside.
This document provides an overview of the GLORP framework for object-relational mapping. GLORP allows mapping Smalltalk domain objects to relational database tables in a generic, lightweight manner. The talk will cover GLORP architecture, building mappings between domain models and database schemas, performing queries, transactions, and writing data. It highlights some less obvious aspects of GLORP like custom functions, grouping queries, and optimizing performance. Contact information is provided for questions about GLORP and Cincom's Smalltalk products.
Object oriented databases store data as objects rather than as basic data types. They evolved from relational databases with the development of object-oriented programming languages in the 1980s. OODBMS allow objects to be stored in databases and support the basic CRUD operations on objects. Some advantages of OODBMS over relational databases include an intuitive object data model, extensibility through inheritance, and tighter coupling between applications and data.
Spring Day | Spring and Scala | Eberhard WolffJAX London
2011-10-31 | 09:45 AM - 10:30 AM
Spring is widely used in the Java world - but does it make any sense to combine it with Scala? This talk gives an answer and shows how and why Spring is useful in the Scala world. All areas of Spring such as Dependency Injection, Aspect-Oriented Programming and the Portable Service Abstraction as well as Spring MVC are covered.
This document summarizes a presentation about using Scala with the Spring framework. It discusses how Spring's core features like dependency injection, aspect oriented programming, and service abstraction can be used with Scala. It provides examples of implementing dependency injection with both XML configuration and annotations. It also discusses how to handle callbacks when using Spring's service abstraction in Scala. Some potential issues and areas for improvement are identified, such as better support for Scala collections and implicit conversions in Spring configuration.
The document outlines a lecture plan for object oriented programming. It covers topics like structures and classes, function overloading, constructors and destructors, operator overloading, inheritance, polymorphism, and file streams. It provides examples to explain concepts like structures, classes, access specifiers, friend functions, and operator overloading. The document also includes questions for students to practice these concepts.
SQLAlchemy is an object-relational mapper (ORM) for Python. It provides patterns for mapping database tables to objects and vice versa. The document discusses several ORM patterns from the book Patterns of Enterprise Application Architecture including:
- Unit of Work pattern which maintains a set of objects to save in a transaction. SQLAlchemy implements this with the Session object.
- Identity Map pattern which avoids duplicate objects for the same database record. SQLAlchemy implements this with its identity map.
- Lazy Load pattern which loads relationships and columns on demand to improve performance. SQLAlchemy uses lazy loading by default.
- Other patterns discussed include foreign key mapping, association table mapping, single/class table inheritance, and how different architectural patterns
Rich Internet Applications con JavaFX e NetBeans Fabrizio Giudici
JavaFX is a software platform for creating rich internet applications (RIAs) using Java that can compete with Flash/Flex and Silverlight, it is based on Java and the JavaFX runtime and includes tools like JavaFX Script for building the user interface and NetBeans as an integrated development environment. JavaFX aims to simplify building RIAs with features like bindings, listeners and components while allowing access to the full Java runtime.
Code is not text! How graph technologies can help us to understand our code b...Andreas Dewes
Today, we almost exclusively think of code in software projects as a collection of text files. The tools that we use (version control systems, IDEs, code analyzers) also use text as the primary storage format for code. In fact, the belief that “code is text” is so deeply ingrained in our heads that we never question its validity or even become aware of the fact that there are other ways to look at code.
In my talk I will explain why treating code as text is a very bad idea which actively holds back our understanding and creates a range of problems in large software projects. I will then show how we can overcome (some of) these problems by treating and storing code as data, and more specifically as a graph. I will show specific examples of how we can use this approach to improve our understanding of large code bases, increase code quality and automate certain aspects of software development.
Finally, I will outline my personal vision of the future of programming, which is a future where we no longer primarily interact with code bases using simple text editors. I will also give some ideas on how we might get to that future.
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Data Con LA
Data transformation has traditionally required expertise in specialized data platforms and typically been restricted to the domain of IT. A domain specific language (DSL) separates the user’s intent from a specific implementation, while maintaining expressivity. A user interface can be used to produce these expressions, in the form of suggestions, without requiring the user to manually write code. This higher level interaction, aided by transformation previews and suggestion ranking allows domain experts such as data scientists and business analysts to wrangle data while leveraging the optimal processing framework for the data at hand.
This document discusses metaprogramming, metaclasses, and the metaobject protocol. It begins with an overview and definitions of key concepts like metaprogramming, metaobjects, and metaclasses. It then covers specific implementations including macros in Lisp, CLOS metaclasses, and how AllegroCache uses a persistent metaclass. Finally, it discusses the metaobject protocol and provides examples of how it allows programs to access and manipulate normally hidden language elements like classes and methods.
First class Variables in Pharo
First Name: Marcus
Last Name: Denker
Type: Talk
Video 1: https://www.youtube.com/watch?v=hEWKV9eWAGY
Video 2: https://www.youtube.com/watch?v=fWo1V_C0cu8
Abstract:
In this talk I will present the first class variables in Pharo:
With Slots, Class, and Global variables, we now model variables
as objects. These mete-objects provide a new reflective API for
variables and in addition, and allow the programmer to introduce
new kinds of variables.
This talk will present the ideas behind and show how to use first class
variables by presenting examples. It will present how variable meta
objects simplify reflecting on variables in combination with Reflectivity.
Bio:
Marcus Denker is a permanent researcher at INRIA Lille - Nord Europe. Before,
he was a postdoc at the PLEIAD lab/DCC University of Chile and the Software
Composition Group, University of Bern. His research focuses on reflection
and meta-programming for dynamic languages. He is an active participant
in the Squeak and Pharo open source communities for many years and the
co-founder of 2Denker/Cologne/Germany. Marcus received a PhD in Computer
Science from the University of Bern/Switzerland in 2008 and a Dipl.-Inform.
(MSc) from the University of Karlsruhe/Germany in 2004.
This document discusses new developments in variable representation in Pharo5. It notes that everything used to be represented as objects, including variables, but variables were represented via associations. In Pharo5, variables are now represented as subclasses of objects called slots and literals. This allows variables to be annotated and have custom behavior via delegation to their metaobjects during code generation. It provides examples of using simple slots, weak slots, and property slots, and outlines the roadmap for further developing the slot system in Pharo6.
Data scientists often have a different background and priorities than software engineers. A lot of the code Data Scientists write never makes it to production, and as a result, the code might not always meet the same standards as production-ready code in a developer team. While it makes sense to have rather lax requirements on code for one-off analyses, this can lead to difficulties in maintaining production code and collaborating on projects with software engineers. Since production code is not (always) the main output of a data science team, it can also be hard to prioritize code quality.
In this presentation, we will go over some of the main principles of clean code and talk about practical steps that data science teams can take to improve their code. We will specifically focus on strategies that teams can implement to slowly and steadily improve the existing code base. This talk is aimed at data scientists who may not have a strong background in software engineering, but are interested in improving code quality and collaborating more effectively with software engineering teams.
A presentation to introduce the Lobos project made at the Bonjure group meeing on 2011/01/21. For more information on Lobos, visit the website: http://budu.github.com/lobos/
Rails is a great Ruby-based framework for producing web sites quickly and effectively. Here are a bunch of tips and best practices aimed at the Ruby newbie.
This document provides a summary of C# versions and new features introduced in C# 7.0, 7.1, 7.2, and 7.3. It discusses features such as binary literals, digit separators, local functions, out variables, tuples, deconstruction, discards, ref returns and locals, pattern matching, expression-bodied members, throw expressions, and more. It also briefly previews some planned features for C# 8.0 like asynchronous streams/sequences, records, ranges, and nullable reference types.
Where's My SQL? Designing Databases with ActiveRecord MigrationsEleanor McHugh
A presentation given at RoReXchange in February 2007. Covers some abuses of the ActiveRecord Migrations mechanism along with examples of simple Rails plug-in design.
This is a toy compiler for the course Compiler 2016 at ACM Class, SJTU. The source language is Mx*. The target is MIPS assembly (in SPIM format).
You can refer to my presentation slides to know something about this compiler and also what I've learnt during the course.
Github: https://github.com/abcdabcd987/compiler2016
When debugging this compiler, I wrote another project LLIRInterpreter(https://github.com/abcdabcd987/LLIRInterpreter) which reads text IR and does interpretation.
This document provides an overview of an introductory C# programming course. The course covers C# fundamentals like setting up a development environment, data types, conditionals, loops, object-oriented programming concepts, and data structures. It includes topics like installing Visual Studio, writing a "Hello World" program, built-in data types like string, integer, boolean, and more. The document also outlines sample code solutions for exercises on command line arguments, integer operations, leap year finder, and powers of two.
Workshop: Identifying concept inventories in agile programmingESUG
This document discusses the development of a concept inventory to identify common misconceptions in agile programming and object-oriented development. The project aims to strengthen collaboration between INRIA/Lille and ÉTS/UQAM by creating a concept inventory that can be used to improve teaching of agile development with object-oriented languages like TypeScript, JavaScript, and Pharo. The methodology involves identifying misconceptions, proposing a concept inventory, and validating it in courses by measuring understanding before and after instruction. A workshop will help identify initial misconceptions in Smalltalk/Pharo by capturing them in a collaborative tool.
This document proposes integrating documentation into the Pharo language metamodel and environment to improve documentation support. It suggests making documentation first-class citizens in Pharo by providing built-in support and a minimal API, which would allow tight integration with development tools and future extensions without requiring grammar changes or large efforts. This could improve documentation quality by enabling direct references between code and documentation and automatic logging of documentation usage.
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
This document outlines advances and the roadmap for debugging tools in Pharo. It discusses recent improvements to the debugging infrastructure, including architectural changes and new debugging commands. It also describes upcoming work, such as additional infrastructure improvements, an emergency debugger, support for meta-object protocols, a redesigned user experience, a remote debugger, and improved documentation. The document concludes by inviting participants to help evaluate new debugging experiments.
The document describes Sequence, a pipeline modeling and discrete event simulation framework developed in Pharo Smalltalk. Sequence allows describing system resources, building blocks that use those resources, assembling scenarios from blocks, collecting information during simulated runs, and interactively exploring system traces. The framework implements a discrete event simulation engine with event streams that model periodic processes and resources. Sequence provides tools for evaluating system performance through simulation before complete hardware is available.
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
This document discusses migrating a monolithic mobile application called CARL Touch to a micro frontend architecture. It presents a migration process involving three steps: 1) analysis of the monolithic codebase, 2) identification of potential micro frontends, and 3) transformation of the codebase to implement the identified micro frontends. Previous experiments at Berger-Levrault involving two teams migrating CARL Touch provided insights. The proposed process uses static and dynamic analysis, code visualization and clustering techniques to help identify optimal micro frontends and transform the codebase in a semi-automated manner.
Analyzing Dart Language with Pharo: Report and early resultsESUG
This document summarizes an analysis of the Dart programming language using tools in the Pharo environment. It describes generating a parser for Dart using SmaCC, which produces an AST. It also details defining a Famix meta-model for Dart and the Chartreuse-D importer that creates a FamixDart model from the AST. Future work is outlined, including improving SmaCCDart, continuing to develop the FamixDart meta-model, and handling dynamic types when importing associations. The goal is to analyze Dart and explore modeling Flutter applications.
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
This document summarizes research on transpiling Pharo classes to JavaScript using ECMAScript 5 versus ECMAScript 6. It finds that transpiling to ES6 provides benefits like significantly faster load times, improved benchmark performance up to 43%, and more idiomatic code compared to ES5. However, fully emulating Smalltalk semantics like metaclass inheritance remains challenging when targeting JavaScript.
The document presents an approach for automated test generation from software models and execution traces. Key aspects of the approach include using metamodels to represent the codebase, values, and desired unit test structure. Models are built from the codebase and traces, then transformations are applied to generate unit tests conforming to the test metamodel. Abstract syntax trees are used to export the generated tests to code. The approach aims to generate tests that are relevant, readable and maintainable without relying on existing tests. An example demonstrates generating a JUnit test from an application class.
Genetic programming is used to generate unit tests by evolving test code via genetic algorithms to maximize coverage. Tests are represented as chromosomes of object and message statements. The genetic algorithm selects tests based on coverage, combines tests through crossover, and replaces tests in the population over generations to find optimal test sequences. Future work includes improving path exploration and comparing with other test generation tools.
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
Threaded execution and continuation-passing style (CPS) allow for smooth switching between execution modes in Zag Smalltalk. Threaded execution interprets code as a sequence of addresses like bytecode but is 2.3-4.7 times faster, while CPS passes continuations explicitly like in functional languages and is 3-5 times faster than bytecode. Both approaches allow fallback to debugging. The implementation shares context and stack between modes to easily switch with proper object structures.
Exploring GitHub Actions through EGAD: An Experience ReportESUG
This document summarizes an experience report on exploring GitHub Actions through EGAD, a tool for GitHub Action analysis. It discusses three key lessons learned: 1) Composing a story by documenting tasks and linking documentation to code, 2) Navigating custom views to conduct research, and 3) Supporting onboarding of researchers by assigning mentors, scheduling meetings, and encouraging use of resources. EGAD takes workflow YAML files, wraps them in a domain model to provide context, and allows inspecting examples to fully explore the GitHub Actions domain model.
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
This document analyzes the reflective features and APIs in Pharo, a reflective programming language. It presents a catalog of Pharo's reflective APIs and analyzes how they relate to metaobjects. The analysis highlights areas for potential improvement, such as providing solutions for intercession on state reads/writes and addressing constraints when changing an object's class. The document contributes to understanding Pharo's reflective design and its evolution over time.
The document discusses garbage collector tuning for applications with pathological allocation patterns. It begins by explaining the motivation and issues caused by pathological patterns, such as applications taking over an hour and a half to run. It then provides an overview of garbage collection and how allocation patterns can impact performance. The document dives into two specific tuning techniques - increasing the full GC threshold to prevent premature full GCs from being triggered, and increasing the tenuring threshold to avoid large objects residing in the remembered set and slowing down scavenges. These tunings resulted in significant performance improvements for the sample DataFrame application, reducing the run time from over an hour and a half to around seven minutes.
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
This document discusses improving garbage collection performance in Pharo through object lifetime profiling. It presents Illimani, a lifetime profiler developed for Pharo. Illimani was used to profile the lifetimes of objects created when loading a large DataFrame. The profiling revealed that most objects had short lifetimes, suggesting the garbage collector could be tuned. Tuning the garbage collector parameters based on the lifetime profiles improved the performance of loading the DataFrame.
This document discusses the past, present, and future of Pharo DataFrames. It began as a student project but has evolved into a mature project with dedicated engineers, improving performance and adding functionality. Future plans include further performance enhancements, adding more functionality, better integration with other Pharo projects, and support for big data. Evaluation of DataFrames is also planned.
This document discusses issues with thisContext in the Pharo debugger not correctly representing the execution context and being the DoIt context instead. This was fixed in Pharo12 by making thisContext a variable object that is wrapped in a DoItVariable, so the debugger context is used. When inspecting or doing DoIt, the doIt Variable is pushed and read to provide the proper execution context.
This document proposes using websockets to display fencing scores and a chronometer from an arena server to mobile phones over the internet in real-time. It includes links to video examples of a chronometer display and photos from fencing competitions.
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
This document discusses PharoJS, which allows developers to develop applications in Pharo and then export them to run as JavaScript applications. PharoJS enables 100% of Pharo code to be executed during development, and then 100% of that same code is exported to JavaScript to be executed in production. The document also briefly mentions deployment options for exported PharoJS applications like GitHub Pages and GitHub Actions.
The document contains testimonials from participants of the Pharo MOOC praising its effectiveness at teaching object-oriented design. It also announces an upcoming advanced design MOOC that will have over 60 lectures, slides, videos and an exercise booklet. Finally, it provides links to the course websites and encourages people to stay tuned for the new MOOC.
A New Architecture Reconciling Refactorings and TransformationsESUG
This document discusses reconciling refactorings and transformations in software engineering. It proposes a new architecture where refactorings decorate transformations by checking preconditions and composing multiple transformations. Refactorings ensure transformations are applied safely while transformations focus on model changes. Open questions remain around precondition handling and composition semantics. The goals are to reduce duplication, support custom refactorings/transformations, and provide a modern driver-based user interface.
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
Mobile app Development Services | Drona InfotechDrona Infotech
Drona Infotech is one of the Best Mobile App Development Company In Noida Maintenance and ongoing support. mobile app development Services can help you maintain and support your app after it has been launched. This includes fixing bugs, adding new features, and keeping your app up-to-date with the latest
Visit Us For :
SMS API Integration in Saudi Arabia| Best SMS API ServiceYara Milbes
Discover the benefits and implementation of SMS API integration in the UAE and Middle East. This comprehensive guide covers the importance of SMS messaging APIs, the advantages of bulk SMS APIs, and real-world case studies. Learn how CEQUENS, a leader in communication solutions, can help your business enhance customer engagement and streamline operations with innovative CPaaS, reliable SMS APIs, and omnichannel solutions, including WhatsApp Business. Perfect for businesses seeking to optimize their communication strategies in the digital age.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Top 9 Trends in Cybersecurity for 2024.pptxdevvsandy
Security and risk management (SRM) leaders face disruptions on technological, organizational, and human fronts. Preparation and pragmatic execution are key for dealing with these disruptions and providing the right cybersecurity program.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
Glorp Tutorial Guide
1. 1
Welcome
August 18, 2014
World Headquarters
Cincinnati, Ohio
How and Where in GLORP: GLORP Tutorial Reference
Slides with Orange Titles: ESUG 2014 Tutorial.
Slides with Blue Titles: additional GLORP info.
Niall Ross, Cincom
GLORP in Cincom® VisualWorks®
(assist Cincom® ObjectStudio®)
2. What is GLORP?
•Generic: abstract, declarative, multi-platform f/w
•Lightweight: looks like Smalltalk
session read: Customer where: [:each | each orders size > 0]
•Object: general hierarchic OO models
no ActiveRecord-like style restriction
remains flexible throughout the lifecycle
•Relational: embedded or bound SQL
•Persistence: transactions, constraints, indexes
3. Glorp Documentation
•GLORP is amazing
GLORP’s documentation is less amazing
Nevin Pratt’s GlorpUserGuide0.3.pdf (in preview/glorp)
(paraphrase) “Before displaying Glorp’s amazing power, I will summarise its raw rear end and show how that could be driven directly. … Having shown how an idiot would (mis)use GLORP, I will now TO BE COMPLETED.”
Good summary of the DB-communicating lowest layer
Roger Whitney’s GLORP Tutorial (www.eli.sdsu.edu/SmalltalkDocs/GlorpTutorial.pdf)
Good course on basic, and some not so basic, things
“beLockKey I have no idea what this does. “
•The greatest wisdom is to know what you don’t know
Cincom
VisualWorks GlorpGuide.pdf – good, getting-started coverage
ObjectStudio MappingToolUsersGuide.pdf – great tool support
And last, but not least …
4. … my ESUG 2013 Talk
•Walk-through GLORP (with demos)
Architecture
Mapping the domain model to the schema
•initial generating / writing step
•refining your mappings
Queries
Commit / Rollback
•Focus on some less obvious aspects
You can all read, and you can all #read:
Follow-up sessions during the conference
5. Example of using Glorp in VisualWorks
•The Store workbook
Is there anything your CM system isn’t telling you?
Open the workbook, run the query
| query |
query := Query read: StoreBundle where:
[:each || q |
q := Query read: StoreBundle where:
[:eachBundle | eachBundle name = each name].
q retrieve: [:x | x primaryKey max].
each username = 'aknight' & (each primaryKey = q)].
query orderBy: [:each | each timestamp descending].
session execute: query.
7. Building GLORP Applications: mapping
•getting started
greenfields or legacy
•write the GLORP and generate the schema into the DB
and/or
•auto-generate the GLORP mapping from an existing DB schema
(ObjectStudio has powerful UI toolset to manage this
Load ObjectStudio-prepared GLORP models in VisualWorks
and/or (re)generate and refine GLORP models programmatically in VW
but this talk will do everything programmatically in VisualWorks.)
•refining / (re)creating in code
make it run, make it right, make it fast
8. Subclass DescriptorSystem to model …
•those (parts of) Smalltalk classes to persist
classModelFor<DomainClassName>:
•the database tables you will write to and read from
tableFor<TABLE_NAME>:
•the mappings (“descriptors”) between the two
descriptorFor<DomainClassName>:
The GLORP f/w finds all the ...For<Name>: methods: creates parameter, names it, calls method with it
9. Template: Class Model
classModelFor<DomainClassName>: aClassModel
aClassModel
newAttributeNamed: #<instvar>
type: <InstvarClass>. “e.g. String, Integer”
...
10. Class models are simple
•Annotate persisted parts of class with type information
Set complex types (and simple if the mapping is tricky)
aClassModel newAttributeNamed: #account type: Account.
aClassModel newAttributeNamed: #name type: String.
Set a collection class if you don’t want OrderedCollection
aClassModel newAttributeNamed: #copies collection: Bag of: Book.
•‘direct access’ (instVarAt:{put:} ) is the default
To instead #perform: getters and setters, do
(aClassModel newAttributeNamed: …) useDirectAccess: false.
(can make it default for the whole descriptor system)
N.B. the index is cached in DescriptorSystem instances
12. Table models have more to them
•Define the table’s fields / columns / attributes
Set types from DatabasePlatform ‘type’ protocol
aTable createFieldNamed: ‘id’ type: platform inMemorySequence.
DatabaseField ‘configuring’ protocol
•bePrimaryKey, beNullable:, isUnique:, beLockKey, defaultValue:
Set foreign keys
aTable
addForeignKeyFrom: storeId to: (custTable fieldNamed: 'STORE_ID')
from: custName to: (customerTable fieldNamed: 'CUSTOMERNAME')
from: custDate to: (customerTable fieldNamed: 'BIRTHDATE').
Set indexes
•beIndexed, addIndexForField:{and:{and:}}, addIndexForFields:
13. Table models (2)
•Image-only Keys, Imaginary Tables
•foreignKey shouldCreateInDatabase: false “just for in-memory structuring”
An object can map to less than one row
•EmbeddedValueOneToOneMapping: target object is not stored in a separate table, but as part of the row of the containing object
or to more/other than one row, e.g.
•GROUP BY / DISTINCT rows in real table
•specific fields from multiple tables
•Some default values need to be platform-aware
converter := booleanField converterForStType: Boolean.
booleanField defaultValue:
(converter convert: false toDatabaseRepresentationAs: booleanField type)
15. Most of the complexity is in Descriptors
•Each persistent class has a descriptor
Most of its complexity is in its Mappings and their Joins
•Descriptors pull together
table(s)
mappedFields
mappings
•and occasional stuff
multipleTableJoin
Cache policy, if different from system
16. Descriptors: table-level mapping
•Trivial: one class = one table, one instance = one row
•Inheritance:
HorizontalTypeResolver: one table per concrete subclass
•target may need polymorphicJoin
FilteredTypeResolver: sparse table with fields of all subclasses
•General:
Imaginary tables: embedded mappings, cross-table mappings
DictionaryMapping: collection type that maps key as well as values
ConditionalMapping, ConditionalToManyMapping
•often employ a ConstantMapping as their ‘else’ outcome
AdHocMapping
17. Descriptors: field-level mapping
•Mapping Types
DirectMapping (DirectToManyMapping): mapping between (collections of) simple types such as Number, String, Boolean, and Timestamp.
ToOneMapping: as direct, when target is a complex object.
•EmbeddedValueOneToOneMapping: target object is not stored in a separate table, but rather as part of the row of the containing object
ToManyMapping: #collectionType:
•Mapping options
•#beForPseudoVariable
use in query, not in Smalltalk class, e.g. DatabaseField>>primaryKeyConstraints
as an alias, e.g. id, not primaryKey
•#shouldProxy: false “true is default”
19. Descriptors: field-level mapping - Joins
Join is a utility class
Join from: (table fieldNamed: ‘FKey’) to: (otherTable fieldNamed: ‘PKey’)
from: … to: …
from: … to: …
•is both easier and safer than
… join: [:each | (each foreignKey = other primaryKey) AND: …]
•because general block expressions must fully define read and write, plus actually it is
… join: [:other | other myEach …] “join expression from target”
The mapping deduces as much as it can
•referenceClass: join: useLinkTable linkTableJoin: targetTableJoin:
•relevantLinkTableFields: - hints for the link table fields
#beOuterJoin, #outerJoin: - false by default (and very usually)
•whether left-side’s unjoined rows discarded or NULL-joined
20. Parsing Mappings and Queries
•The message eater (MessageArchiver) eats the block
•N.B. avoid inlined selectors, e.g. use AND: or &
•Messages in the block are mapped (in order) to
Functions
Mapped symbols: just #anySatisfy: and #select:
Performed special selectors (Glorp internal or ST mimic) e.g.
•#isEmpty #notEmpty #asDate #getTable: #getField: #fieldNamed: #parameter: #noneSatisfy: #getConstant: #count: #sum: #min: #max: #average: #sqlSelect: #includes: #aggregate:as:
Named attributes
Relationships
21. Functions are easy to add
•A basic list of generic functions, e.g
at: #distinct put: (PrefixFunction named: 'DISTINCT');
at: #, put: (InfixFunction named: '||');
at: #between:and: put: (InfixFunction named: #('BETWEEN' 'AND'));
at: #countStar put: (StandaloneFunction named: 'COUNT(*)');
at: #cast: put: ((Cast named: 'CAST') separator: ' AS ');
•... is added to by specific subclasses, e.g. DB2Platform
at: #days put: ((PostfixFunction named: 'DAYS') type: (self date));
enables this to work in DB2 as well
where: [:each | each startDate + each daysToBonus days < Date today]
(New feature: Date arithmetic is now better supported)
22. Sort Order
•#orderBy: isn't a sortblock. It defines the order field(s)
query
orderBy: #name ;
orderBy: [:each | each address streetNumber descending].
•Lacking a suitable field, you can assign one
mapping
orderBy: (myTable fieldNamed: 'COLLECTION_ORDER');
writeTheOrderField.
•Or you can sort in Smalltalk
•anywhere you can specify a collection class, you can also use an instance
query collectionType: (SortedCollection sortBlock: [:a :b | a isSuffixOf: b]).
(N.B. if data read via a cursor, Smalltalk-side sorting is iffy)
24. Queries
•The GlorpSession ‘api/queries’ protocol …
session readOneOf: Book where: [:each | each title = ‘Persuasion’].
session read: Book where: [:each | each title like ‘Per%’] orderBy: #author.
•… duplicates the API of Query class and subclasses
in complex cases, configure Query then execute:
previously divergent protocol now deprecated
•use #read: not #readManyOf: or #returningManyOf:
•Like Seaside, utility protocol plus cascades
•#read:limit: #read:where:limit: #read:orderBy: #read:where:orderBy: #count: #count:where:
25. Grouping by multiple criteria added
Must not return conflicting values in any of the returned fields
| books query |
query := Query read: Book.
query groupBy: [:each | each title].
query groupBy: [:each | each author].
query orderBy: [:each | each title].
query retrieve: [:each | each title].
query retrieve: [:each | each author].
query retrieve: [:each | each copiesInStock sum].
books := session execute: query.
B/W-compatible API kept; a few changes made:
•hasGroupBy -> hasGrouping
•usesArrayBindingRatherThanGrouping -> usesArrayBindingRatherThanGroupWriting
26. Query Performance: Reads
Do as much on server as possible
•use complex where clause
•use CompoundQuery
query1 unionAll: query2
query1 except: query2
Configure the query
•#retrieve: gets less, #alsoFetch: gets more (also #shouldProxy: on mapping)
•#expectedRows: preps caches
Exploit database functions
Use a cursor (not in PostgreSQL as yet)
•query collectionType: GlorpCursoredStream
GlorpVirtualCollection wraps a stream internally (size requires separate query)
27. Query Performance: Reads (2) - DIY
Prepare your own Glorp Command
SQLStringSelectCommand new setSQLString: ‘select * from customers’.
myCommand := SQLStringSelectCommand
sqlString: 'SELECT id FROM books WHERE title=? AND author= ?’
parameters: #(‘Persuasion’ ‘Jane Austen’) “or use :param and a dictionary”
useBinding: session useBinding
session: session.
and run it as a command
query command: myCommand.
session execute: query.
or run it directly against the database
session accessor executeCommand: myCommand
28. Symbols, Blocks or Queries as params
•#where:, #orderBy:, etc. take symbol, block or query
cloneQuery := Query read: pundleClass where:
[:each || othersQuery parentIdsQuery |
parentIdsQuery := Query read: pundleClass where: [:e | e previous notNil].
parentIdsQuery retrieve: [:e | e previous id distinct].
parentIdsQuery collectionType: Set.
othersQuery := Query read: pundleClass where:
[:e | (e id ~= each id) & (e name = each name) &
(e version = each version) & (e timestamp = each timestamp)].
(each timestamp < cutoffTimestamp)
& (each exists: othersQuery)
& (each id notIn: parentIdsQuery)].
cloneQuery collectionType: Bag.
Performance sometimes needs all to be done on server.
29. Invoke Functions via Expressions
If you want a function to prefix a subselect …
SELECT distinct A.methodRef FROM tw_methods A WHERE not exists
(SELECT * FROM tw_methods B WHERE
B.packageRef not in (25, 36) and A.methodRef = B.methodRef)
and A.packageRef in (25, 36);
… call it on the imported parameter
packageIdsOfInterest := #(25 36).
query := Query read: StoreMethodInPackage where:
[:each | (each package id in: packageIdsOfInterest) AND: [each notExists:
(Query read: StoreMethodInPackage where:
[:mp | mp definition = each definition
AND: [mp package id notIn: packageIdsOfInterest]])]].
query retrieve: [:each | each definition id distinct].
30. Template: Session Writing
session
beginUnitOfWork;
register: obj; “obj is a domain instance”
commitUnitOfWork.
session inUnitOfWorkDo: [session register: obj].
(see GlorpSession protocol ‘api/transactions’)
31. Transaction (DB) v. UnitOfWork (Image)
•Transaction: database maintains integrity via transactions, commits or rolls-back changes at transaction boundaries.
The DatabaseAccessor holds the current transaction
•UnitOfWork: holds changed objects and their unchanged priors, can roll-back Smalltalk-side changes in the image.
The GlorpSession holds the current UnitOfWork
•Users must manage (unavailable) nesting
#inUnitOfWorkDo: defers to an outer UnitOfWork
#beginUnitOfWork errors if called within an outer UnitOfWork
(likewise for #inTransactionDo: versus #beginTransaction)
32. Transaction v. UnitOfWork (2)
•#transact:
puts UnitOfWork inside Transaction, commits/rolls-back both, paired
•#commitUnitOfWork (or #commitUnitOfWorkAndContinue)
creates and commits a transaction if none is present
does not commit if a transaction is present
•#doDDLOperation:
for table creation, deletion, alteration; some databases require a transaction in those cases, others do not
•(and SQLServer does sometimes but not always :-/ )
Writing is transactionally-controlled; no explicit write function.
33. Writing
Objects that are registered and then changed are written
•read in a unit of work = registered, otherwise register explicitly
•#save: forces write, whether changed or not
Process
•inserts become updates when possible
•RowMap is prepared, ordered (e.g. for foreign key constraints), written
Performance
•gets all sequence numbers at start of a transaction
•prepared statements are cached, and arguments bound
•inserts can use array binding, or statement grouping
Instances <-> RowMap entries
•Mementos allow rollback in image
34. 2013 Cincom Systems, Inc. All Rights Reserved Developed in the U.S.A. CINCOM and the Quadrant Logo are registered trademarks of Cincom Systems, Inc. All other trademarks belong to their respective companies.
35. Contact info
•Glorp
nross@cincom.com Glorp team
dwallen@cincom.com Glorp team
trobinson@cincom.com Major internal customer
•Star Team (Smalltalk Strategic Resources)
sfortman@cincom.com Smalltalk Director
athomas@cincom.com Smalltalk Product Manager
jjordan@cincom.com Smalltalk Marketing Manager
•http://www.cincomsmalltalk.com