BEXIS Tech Talk Series
#3: The System Architecture
Javad Chamanara
March 2016
Recall from the first talk
• Requirements
– Data Lifecycle Management
– Generic
– Extensible
– Portable
– Scalable
BEXIS T...
Requirements -> DLM
• Flexible Data Structures
• Data Submission
• Validation
• Preserving
• Metadata Management
• Version...
Recall from the second talk
BEXIS Tech Talk #3: The System Architecture 4
DataMetadata
Data StructureMetadata Structure Se...
Core Conceptual Model
BEXIS Tech Talk #3: The System Architecture 5
SearchPublishing
CMLand Use
Reservation
Data
Submission
DLM APIs
BEXIS Tech Talk #3: The System Architecture 6
Core Functions
Data Structure Mgmt.
Data Mgmt.
Metadata Mgmt.
Sem. ...
Multi DBMS data access
BEXIS Tech Talk #3: The System Architecture 7
DB2 PgS
Data Access
Core Functions
...
Relational
XML...
Access to the Core Functions
BEXIS Tech Talk #3: The System Architecture 8
DB2 PgS
Data Access
Core Functions
UI Framework...
Access to Core Functions
BEXIS Tech Talk #3: The System Architecture 9
DB2 PgS
Data Access
Core Functions
UI
UI Framework
...
Security
BEXIS Tech Talk #3: The System Architecture 10
DB2 PgS
Data Access
Security
Core Functions
UI
UI Framework
...
Mo...
Architectural Patterns
• Generic User Interaction
• MVC
• APIs, Web APIs
• Data Access
• Services
BEXIS Tech Talk #3: The ...
Generic User Interaction
BEXIS Tech Talk #3: The System Architecture 13
Presentation
User
Services Core Services Security ...
Presentation: MVC
BEXIS Tech Talk #3: The System Architecture 14
class mvc
Controller
ModelView
«observe»
«observe»
Simplified MVC
BEXIS Tech Talk #3: The System Architecture 15
class mvc
View ViewModel
Controller
«observe»
Dependency
Classes Engaged in an Interaction
BEXIS Tech Talk #3: The System Architecture 16
Controller
View
Service Framework API
Dat...
BExIS MVC Sequence Diagram
BEXIS Tech Talk #3: The System Architecture 17
User
Controller Model ServiceViewRouting Engine
...
MVC Constraints
• Passive Models
• Request more data
• Manipulate entities
• Models are POCOs
• Models have no access to s...
Controller
View
Service Framework API
Data
GIS Data
ViewModel
«Observe»
«use»
«use»
BEXIS Tech Talk #3: The System Archite...
Integration
• Service Based
– Modules provide a set of services
• HTTP/S + Auth
– Internal authentication
– Remote LDAP/ A...
Public APIs
• Web API
– API namespace
• Module/Controller/Action
• Verb
• Data
• www.example.com/dcm/datasets/1
• www.exam...
Modularity
• Modules
– A set of related user facing functions
– To extend the application’s functionality
• Layering
– Pre...
Modularity
• Integration
– Shell integration: menus, themes, scripts, etc.
– Authorization
• Introducing actions, to be se...
Data
• Relational data
– Schema evolution
– Schema generation
– Data versioning
– Vendor/tool independence
• XML data
– Fi...
Data Access
• ORM
– NHibernate
– Vaiona
BEXIS Tech Talk #3: The System Architecture 25
Data Access Patterns
• Repository pattern
– CRUD on entities
– Querying using
• LINQ to objects
• HQL
• Native SQL (querie...
Data Access Patterns
• Unit of Work pattern
– Business Transaction Management
– Concurrency Control
– Operating on multipl...
Data Access Patterns
• Aggregates
– Cluster of entities and their dependents
• Datasets and their Versions
• Units of meas...
Data Access Patterns
• Materialization
– Complex entity serialized as XML
– Stored in field of a table row
– Materialize o...
ORM example
• Dataset as an Aggregate area
• DataTuple
• DataCell
• Versions
• Associations
BEXIS Tech Talk #3: The System...
Dataset aggregate: conceptual
diagram
BEXIS Tech Talk #3: The System Architecture 31
Dataset
Dataset VersionDataset Stage
...
Dataset aggregate: class diagram
BEXIS Tech Talk #3: The System Architecture 32
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
General Record Structure
Identification
Payload
Associations
Versioning
Audit
State
Technical
Extra
BEXIS Tech Talk #3: Th...
ORM mapping: The entity
<hibernate-mapping xmlns="urn:nhibernate-
mapping-2.2" assembly="BExIS.Dlm.Entities"
namespace="BE...
ORM mapping: Non payload
attributes
<id name="Id" type="Int64">
<column name="Id" />
<generator class="native" />
</id>
<v...
ORM mapping: State attributes
<component name="StateInfo">
<property name="State" type="string">
<column name="State" />
<...
ORM mapping: Payload
attributes
<property name="LastCheckIOTimestamp" type="DateTime">
<column name="LastCheckIOTimestamp"...
ORM mapping: Associations
<set name="Versions" inverse="true" lazy="true" order-
by="Timestamp desc" cascade="all-delete-o...
Dataset aggregate: Database
Schema
BEXIS Tech Talk #3: The System Architecture 47
How to work with the model
DatasetManagerService dms = new DatasetManagerService();
Dataset ds = dms.CreateEmptyDataset(sd...
Inside the “Check In” service
method
public void CheckInDataset
(Int64 datasetId, string comment, string userName)
{
using...
Outlook
Whats next in the talk series?
• General purpose components
• Third party components
• Cross-cut functionalities
B...
5252
Thanks!
Questions?
Contact:
javad.chamanara@uni-jena.de
http://fusion.cs.uni-jena.de/bexis
BEXIS Tech Talk #3: The Sy...
Nächste SlideShare
Wird geladen in …5
×

3 the system architecture

224 Aufrufe

Veröffentlicht am

This presentation is dedicated to the architectural design of BExIS, which describes the overall architecture, layering, molecularity, important components, and the data access techniques using an ORM.
The video of the talk is available at: https://www.youtube.com/watch?v=txLIDgEn59M

Veröffentlicht in: Software
0 Kommentare
2 Gefällt mir
Statistik
Notizen
  • Als Erste(r) kommentieren

Keine Downloads
Aufrufe
Aufrufe insgesamt
224
Auf SlideShare
0
Aus Einbettungen
0
Anzahl an Einbettungen
2
Aktionen
Geteilt
0
Downloads
6
Kommentare
0
Gefällt mir
2
Einbettungen 0
Keine Einbettungen

Keine Notizen für die Folie
  • Just focus on the DLM
  • Modules have a complete talk
  • This is a typical Controller action
  • 3 the system architecture

    1. 1. BEXIS Tech Talk Series #3: The System Architecture Javad Chamanara March 2016
    2. 2. Recall from the first talk • Requirements – Data Lifecycle Management – Generic – Extensible – Portable – Scalable BEXIS Tech Talk #3: The System Architecture 2
    3. 3. Requirements -> DLM • Flexible Data Structures • Data Submission • Validation • Preserving • Metadata Management • Versioning BEXIS Tech Talk #3: The System Architecture 3
    4. 4. Recall from the second talk BEXIS Tech Talk #3: The System Architecture 4 DataMetadata Data StructureMetadata Structure Semantics Geo Administration Security «use» «use» «use» «use» «use»
    5. 5. Core Conceptual Model BEXIS Tech Talk #3: The System Architecture 5 SearchPublishing CMLand Use Reservation Data Submission
    6. 6. DLM APIs BEXIS Tech Talk #3: The System Architecture 6 Core Functions Data Structure Mgmt. Data Mgmt. Metadata Mgmt. Sem. Data Mgmt.
    7. 7. Multi DBMS data access BEXIS Tech Talk #3: The System Architecture 7 DB2 PgS Data Access Core Functions ... Relational XML GIS Multi DBMS support Vendor unlocking ORM support Customization support Data Structure Mgmt. Data Mgmt. Metadata Mgmt. Sem. Data Mgmt.
    8. 8. Access to the Core Functions BEXIS Tech Talk #3: The System Architecture 8 DB2 PgS Data Access Core Functions UI Framework ... Modularity Integration
    9. 9. Access to Core Functions BEXIS Tech Talk #3: The System Architecture 9 DB2 PgS Data Access Core Functions UI UI Framework ... Modularity Integration Synthesis Work Semantic Search Analytics User Defined Spatial Querying External Tools Web Services Archiving Import/ Export Publishing
    10. 10. Security BEXIS Tech Talk #3: The System Architecture 10 DB2 PgS Data Access Security Core Functions UI UI Framework ... Modularity Integration Synthesis Work Semantic Search Analytics User Defined Spatial Querying External Tools Web Services Archiving Import/ Export Publishing
    11. 11. Architectural Patterns • Generic User Interaction • MVC • APIs, Web APIs • Data Access • Services BEXIS Tech Talk #3: The System Architecture 12
    12. 12. Generic User Interaction BEXIS Tech Talk #3: The System Architecture 13 Presentation User Services Core Services Security Data Access
    13. 13. Presentation: MVC BEXIS Tech Talk #3: The System Architecture 14 class mvc Controller ModelView «observe» «observe»
    14. 14. Simplified MVC BEXIS Tech Talk #3: The System Architecture 15 class mvc View ViewModel Controller «observe» Dependency
    15. 15. Classes Engaged in an Interaction BEXIS Tech Talk #3: The System Architecture 16 Controller View Service Framework API Data GIS Data ViewModel «Observe» «use» «use»
    16. 16. BExIS MVC Sequence Diagram BEXIS Tech Talk #3: The System Architecture 17 User Controller Model ServiceViewRouting Engine Request() action() GetData() Populate() Bind() Render()
    17. 17. MVC Constraints • Passive Models • Request more data • Manipulate entities • Models are POCOs • Models have no access to services • Models may have builder/ transformers • Views can interact with controllers’ actions only – Interchanging data – Calling controllers’ actions either sync or async • No lazy loading in the Views (populated models+ajax) BEXIS Tech Talk #3: The System Architecture 18
    18. 18. Controller View Service Framework API Data GIS Data ViewModel «Observe» «use» «use» BEXIS Tech Talk #3: The System Architecture 19 Presentation Data Business
    19. 19. Integration • Service Based – Modules provide a set of services • HTTP/S + Auth – Internal authentication – Remote LDAP/ Active Directory integration • Authorization – Restricts access to controllers’ actions – Public actions – Public data BEXIS Tech Talk #3: The System Architecture 20
    20. 20. Public APIs • Web API – API namespace • Module/Controller/Action • Verb • Data • www.example.com/dcm/datasets/1 • www.example.com/dcm/datasets/1/versions • www.example.com/dcm/versions/10 • Querystrings are allowed • No versioning on APIs! Always the latest!! BEXIS Tech Talk #3: The System Architecture 21
    21. 21. Modularity • Modules – A set of related user facing functions – To extend the application’s functionality • Layering – Presentation • MVC – Service • Access to Core services, DLM, external services, etc. – Data Access • Own Database/data • Direct access to the DB/data (not recommended) BEXIS Tech Talk #3: The System Architecture 22
    22. 22. Modularity • Integration – Shell integration: menus, themes, scripts, etc. – Authorization • Introducing actions, to be secured, to the system • Automatic security trimming/ action authorization • Notes – Deployment – Hot plug-abilities – Upgrading/versioning BEXIS Tech Talk #3: The System Architecture 23
    23. 23. Data • Relational data – Schema evolution – Schema generation – Data versioning – Vendor/tool independence • XML data – File based XML – RDBMS based XML • GIS data – External systems – Integrated querying – Security BEXIS Tech Talk #3: The System Architecture 24
    24. 24. Data Access • ORM – NHibernate – Vaiona BEXIS Tech Talk #3: The System Architecture 25
    25. 25. Data Access Patterns • Repository pattern – CRUD on entities – Querying using • LINQ to objects • HQL • Native SQL (queries, views, stored-procedures) • Vendor specific customization – Relationship traversal • Laziness/Eagerness • object graph traversal – Automatic entity state/context management – Based on: http://martinfowler.com/eaaCatalog/repository.html BEXIS Tech Talk #3: The System Architecture 26
    26. 26. Data Access Patterns • Unit of Work pattern – Business Transaction Management – Concurrency Control – Operating on multiple repositories – Transactions • Distributed Transaction Coordination • Transparent transaction management • Ambient transaction detection/reuse – Web request/session/user aware transaction mgmt. – Automatic commit on request/session termination – Based on: http://martinfowler.com/eaaCatalog/unitOfWork.html BEXIS Tech Talk #3: The System Architecture 27
    27. 27. Data Access Patterns • Aggregates – Cluster of entities and their dependents • Datasets and their Versions • Units of measurement and their conversion formula – Simplify the service layer – Packaged as units of work – Better business level operation/transaction mgmt. – Look at: http://martinfowler.com/bliki/DDD_Aggregate.ht ml BEXIS Tech Talk #3: The System Architecture 28
    28. 28. Data Access Patterns • Materialization – Complex entity serialized as XML – Stored in field of a table row – Materialize on read • Reads the XML and loads the entity – Dematerialize on write • Serializes the object as an XML document – Used in Data Tuples of dataset versions BEXIS Tech Talk #3: The System Architecture 29
    29. 29. ORM example • Dataset as an Aggregate area • DataTuple • DataCell • Versions • Associations BEXIS Tech Talk #3: The System Architecture 30
    30. 30. Dataset aggregate: conceptual diagram BEXIS Tech Talk #3: The System Architecture 31 Dataset Dataset VersionDataset Stage Tuple DataValue Data Cell Data Structure 1 +Current Stage 1 10..1 1 1 +Variable Values {Delta Association, Only Structured Data}
    31. 31. Dataset aggregate: class diagram BEXIS Tech Talk #3: The System Architecture 32
    32. 32. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 33
    33. 33. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 34 Identification: it holds information about primary keys, key generation, etc.
    34. 34. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 35 Payload: is the business data that the table holds
    35. 35. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 36 Associations: relationships between this table and others (also itself). Connected and not connected foreign keys fall into this category, too.
    36. 36. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 37 Versioning: information about version number and timestamp. This is the technical data level versioning to be used in concurrency control. It is not the business level data versioning.
    37. 37. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 38 Audit: the information about the person or the system who has changed the data in addition to the time, action, and other information
    38. 38. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 39 State: shows the current status of the data record. It can be set by business workflows or quality control, e.g., “Approved”, “Rejected”, “Published”, “Locked”, etc.
    39. 39. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 40 Technical: this part is used for development purposes and is not intended to be used by data owners or data consumers
    40. 40. General Record Structure Identification Payload Associations Versioning Audit State Technical Extra BEXIS Tech Talk #3: The System Architecture 41 Extra: It is an XML field to provide a place for minor extensions and reduce the amount and frequency of changes in the database schema (and sometimes data). Also, it can be considered as an exertion point for customization in different scenarios.
    41. 41. ORM mapping: The entity <hibernate-mapping xmlns="urn:nhibernate- mapping-2.2" assembly="BExIS.Dlm.Entities" namespace="BExIS.Dlm.Entities.Data"> <class xmlns="urn:nhibernate-mapping-2.2" name="Dataset" table="Datasets"> </class> </hibernate-mapping> BEXIS Tech Talk #3: The System Architecture 42
    42. 42. ORM mapping: Non payload attributes <id name="Id" type="Int64"> <column name="Id" /> <generator class="native" /> </id> <version name="VersionNo" type="Int32"> <column name="VersionNo" /> </version> <property name="Extra" type="System.Xml.XmlDocument, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="Extra" not-null="false" sql- type="xml" /> </property> BEXIS Tech Talk #3: The System Architecture 43
    43. 43. ORM mapping: State attributes <component name="StateInfo"> <property name="State" type="string"> <column name="State" /> </property> <property name="Timestamp" type="DateTime"> <column name="StateTimestamp" not-null="false"/> </property> <property name="Comment" type="string"> <column name="StateComment" /> </property> </component> Same for Creation Info and Modification Info BEXIS Tech Talk #3: The System Architecture 44
    44. 44. ORM mapping: Payload attributes <property name="LastCheckIOTimestamp" type="DateTime"> <column name="LastCheckIOTimestamp" /> </property> <property name="CheckOutUser" type="string"> <column name="CheckOutUser" /> </property> BEXIS Tech Talk #3: The System Architecture 45
    45. 45. ORM mapping: Associations <set name="Versions" inverse="true" lazy="true" order- by="Timestamp desc" cascade="all-delete-orphan"> <key> <column name="DatasetRef" /> </key> <one-to-many class="DatasetVersion" /> </set> BEXIS Tech Talk #3: The System Architecture 46
    46. 46. Dataset aggregate: Database Schema BEXIS Tech Talk #3: The System Architecture 47
    47. 47. How to work with the model DatasetManagerService dms = new DatasetManagerService(); Dataset ds = dms.CreateEmptyDataset(sds, rp, ms); DatasetVersion workingCopy = dms.GetDatasetWorkingCopy(ds); // edit the version dms.CheckInDataset(ds, “new version is created.", user); BEXIS Tech Talk #3: The System Architecture 48
    48. 48. Inside the “Check In” service method public void CheckInDataset (Int64 datasetId, string comment, string userName) { using(IUnitOfWork uow = this.GetUnitOfWork()) { IRepository<Dataset> repo = uow.GetRepository<Dataset>(); Dataset ds = repo.Get(…).FirstOrDefault(); // Check-in logic here… repo.Put(ds); uow.Commit(); } } } BEXIS Tech Talk #3: The System Architecture 49
    49. 49. Outlook Whats next in the talk series? • General purpose components • Third party components • Cross-cut functionalities BEXIS Tech Talk #3: The System Architecture 51
    50. 50. 5252 Thanks! Questions? Contact: javad.chamanara@uni-jena.de http://fusion.cs.uni-jena.de/bexis BEXIS Tech Talk #3: The System Architecture Acknowledgment

    ×