Saturday, May 2, 2015

Today we will continue our discussion on DBPowder. We will look into the conceptual model introduced by this framework. This paper proposes the following data models:
1) Object Model : This object is based on the subset of ODMG 3.0 standard, with some Java-based extensions. An object is called persistent  if all property values are saved into the storage in order they may be retrieved later. Let us take an example with a class User that has an attribute user_name and has a relationship register to another class Register. The Register class also has a relationship user to the class User. Therefore the two classes have a bidirectional relationship. The cardinality is 1:n  A class AdmUser is a sub class of the class User and the class User has a superclass of AdmUser and a class GuestUser
2) RelationalModel: The relational model has a table user and an attribute user_name and primary key user_id. A table register has a foreign key user_id to the table user.
3) EER model in DBPowder : The EER model describes the primitives such as attributes, entity, relationship, connectivity etc. The notations used are : e defines a fact,  e has one or more attributes A1, A2 .. An. Entity E comprises of  a set of facts | the entire attributes. Relationships are expressed as connectivity which represents cardinality.The relationship among three or more entities is described by another entity E' and connecting E' to each of the entities E1, E2, E3.
In the example taken earlier an entity user p has an attribute user_name q and a relationship r to an entity register. r has a connectivity 1:n. For entity user, the occurrence of entity register  is mandatory , a constraint represented by s. The entities of user, adm_user and guest_user form a hierarchy with user as the base. Thus the EER can be used to generate both the relational tables as well as the simple correspondences. 

Friday, May 1, 2015

Today we continue reading the paper on DBPowder. We brought up the mention that Hibernate allows multiple complex correspondence with HBM files. Using Hibernate Annotations which is a supplemental tool, the developer can describe classes with annotations but they too don't improve the Hibernate.
ADO.Net entity model is another popular method which has a conceptual schema description language, a store schema description language and a mapping specification language - all represented in xml. As part of MSL, Melnik proposed a method with bidirectional views which describe a set of constraints between a group of tables and persistent classes. The compiler compiles the constraints to generate the query views and update views for complex correspondences.
Msquare-ORMsquare is another method bur it requires a relational schema and persistent classes in advancey
A relational view extends the original table but views and persistent classes  still need to be described to utilize ORM moreover when data manipulations are performed on the views, they may not be properly reflected on the original table. Also views have to be unfolded to original tables with complex queries causing poorer performance. For object oriented software design, uml is popular.
In this paper, while the authors adopted an EER model to clarify the issues, a design in the EER model can be easily converted into that by the UML Class diagram. This enables simple to complex correspondence comparison because simple uses EER and complex uses ObjectView, in addition to EER.
#codingexercise


GetOddNumberRangePowerTenthRootPowerTwenty(Double [] A)


{


if (A == null) return 0;


Return A.OddNumberPowerTenthRootPowerTwenty();


}



Thursday, April 30, 2015

Today we continue reading the paper on DBPowder. We were reviewing related technologies Today we will continue some more discussion. Hibernate is mentioned as an  ORM that handles complex correspondence. Here developers describe mappings between the persistent classes and the relational schema in hbm files. This file is used to generate code and table. However, each time the hbm needs to be updwted, it is pretty disruptive. Even with annotations the expressibility of the mapping isn't improved. While we talk about ORM framework, we don't talk about the mark and sweep required for Graph API. Those we read in distributed computing. Here we read the paper for improvements to the mapping framework. Also we were hinting at writing Graph API for Active Directory objects CRUD. That cannot work unless AD objects CRUD works via LDAP protocol. We need proper credentials and reserved OU. And even so, will most likely require a ticketing framework for changes to be captured in audit trail.

Wednesday, April 29, 2015

Today we continue reading the paper introducing DBPowder as we did in the previous post. We said that for complex correspondences, the developer needs to specify the complete correspondence among persistent classes and tables. which is not always possible because they are subject to change. With DBPowder, simple and complex correspondences are supported with a collaboration of a conceptual model and a navigational data usage description. During the initial rapid development, developers describe an Extended Entity Relationship model and DBPowder generates schema and classes for this model. During the latter spiral development, DBPowder introduces ObjectView, a graph based object description form over the EER model. The developers can refine their EER models and add ObjectView. and then DBPowder refines the existing relational schema and persistent classes and adds persistent classes for ObjectView.
In the discussion on related works, the authors mention ActiveRecord which is a one to one mapping between table and attributes - attributes of ActiveRecord are defined with those of the table. The advantage of this approach is that its simple but doesn;t work for complex correspondences.
Another example is the conceptual model eg. ER model as the basis such as WebML and Enterprise Objects Framework. Here schema and classes are generated from the conceptual model.
A third approach was introduced by Thiran et al which uses wrapper based ORM and applies the eight transformation operators one after the other to a target relational schema.  The descriptive power is limited within these operators.
#codingexercise


GetOddNumberRangePowerSeventhRootPowerTwenty (Double [] A)


{


if (A == null) return 0;


Return A.OddNumberPowerSeventhRootPowerTwenty();


}

Tuesday, April 28, 2015

Today we will start reading another research paper. This one is titled : DBPowder : A flexible object relational mapping framework based on a conceptual model. written by Murakami, Amagasa, Kitagawa et al. Object Relational mapping framework are well known to web application developers for the convenience they provide in programming data objects and persisting to a database. The relational schema is abstracted by an object graph that enables seamless data persistence. The authors begin by recognizing that there are many such ORM frameworks and most of them have to compromise two contradictory requirements, 1) that is the support of persistence classes that are directly mapped to relational table. and 2) the support of complicated compositions of base classes which are required by the application. These are two strong requirements and they become clearer as the application evolves. Initially a one to one mapping between each persistent class and their respective table is required and as the development proceeds, more complicated correspondences between persistent classes and relational tables are needed as the development proceeds. Foytr this reason, it is desirable for an ORM framework to be flexible enough between these two ends of the spectrum at different development stages.
In this paper, the authors do that by proposing a framework called DBPowder that addresses the difficulty in handling simple and complex correspondences.  DBPowder supports direct mapping to tables with Extended Entity Relationship Model and it supports complicated compositions with ObjectView, a graph based object description form over the EER model.  The EER model and the ObjctView together provide the flexibility that is required in different development stages.
Through out this paper the authors use the term simple correspondence and complex correspondence for 1) and 2) mentioned earlier. They refer to the classes in ORM as a) persistence classes that deal with persistent data in an object oriented language. b) relational schema to manage the persistent data in the RDB. and c) data conversion between object states and RDB queries and responses.
If we take the example of users and hosts, that have a many to many relationship as captured in a third join table, then we can have a simple correspondence with more complicated mappings possible by defining the mappings by hand.

Monday, April 27, 2015

Today we start reading up on Azure AD Graph API. This has let different web clients, applications and services to take advantage of doing CRUD on AD Artifacts directly. We will review some of the sample code to connect with this Graph API also. Graph APIs are as relevant to a cloud API provider as a portal to the user. In this section, we cover the usability aspect of the Graph APIs.
First of all the Azure AD Graph APIs lists entities and types and the operations that can be performed on them. These are REST based APIs so they follow the common REST standards.  The entities exposed by the APIs include Application, AppRoleAssignment, Contact, Device, DirectoryLinkChange, DirectoryObject, DirectoryRole, DirectoryRoleTemplate, ExtensionProperty, Group, OAuth2PermissionGrant, ServicePrincipal, SubscribedSKU, TenantDetail, User etc.
The complex types exposed by this API include AlternativeSecurityId, AppRole, AssignedLicense, AssignedPlan, KeyCredential, LicenseUnitsDetail, OAuth2Permission, PasswordCredential, PasswordProfile, ProvisionedPlan, Provisioning Error, RequiredResourceAccess, ResourceAccess, ServicePlanInfo, ServicePrincipalAuthenticationPolicy, VerifiedDomain etc.
In addition, the API is popular for the operations on the AD artifacts such as Users, Groups, Roles and Contacts.
The Operations on Users include CreateUser, GetUser(s), UpdateUser, DeleteUser, GetUserDirectReports, Get Users GroupMemberships, Get Users manager, Update Users manager, Reset User's Password.
The Operations on Group include CreateGroup, GetGroup(s), UpdateGroup, DeleteGroup, GetGroupMembers, AddaMemberToAGroup, RemoveaMemberFromAGroup, CheckGroupMembership, CheckGroupMembershipInList, GetAllGroupMemberships (transitive).
Roles and Contacts can only be listed with this Graph APIs.
DirectoryExtensions can also be created, updated and deleted with these APIs. Directory extensions enables application developers to extend the directory and develop richer applications without worrying about the limitations exposed by an external store. For example, user, Group, TenantDetail, Device, Application, and ServicePrincipal can be extended with String Type or BinaryType Single Valued Attributes. A single string attribute can take say 256 characters and 100 such extension values are permitted on a single object. A SkypeID for a user can be taken as an extension.

#codingexercise


GetOddNumberRangeSumSeventhRootPowerTwenty (Double [] A)


{


if (A == null) return 0;


Return A.OddNumberSumSeventhRootPowerTwenty();


}

Sunday, April 26, 2015

Today we take a break to cover go language.  This is an opensource programming language and works on Linux, Mac, Windows and more. Code is brief and explains itself succinctly. Code is organized into packages. Functions, types, constants and variables have to be exported from a package before being used with their package qualifiers.
In Go code, errors are values, checked with if err != nil syntax.
As an example, token, err := scanner.Scan()
if (err != nil) {
        return err;
}
Multivalue return from functions are common. Most library code have one or two checks only per file. Types keep the data, operation and error together. So there is no need for callers to check after each call to a type. They can multiple calls and assume that an error would have triggered subsequent calls to fail.
Code is automatically organized into bin, pkg, src and referenced via paths.
Testing is available via lightweight test framework that exposes syntax such as a func ( t *testing.T). The tests call a failure function such as t.Error or t.Fail and the test functions themselves are named TestFooBar etc.
Formatting follows simple C like syntax. with fmt.Printf statements or log.Println
Interfaces are named with a convention where they end with an -er after their primary behaviour.
Allocation primitives are new and make.  new does not initialize memory it only returns a zero valued address A zero value for a mutex is an unlocked mutex. A zero value of the Buffer means its empty and ready to use. Consequently those types with buffers and mutexes are initialized by the same new.
make creates slices, maps and channels only and it returns an initialized not zeroed value of type and so references to data structures must be initialized separately.
Data is represented as Arrays, slices and maps. Arrays and slices are one dimensional. Slices can be of variable lengths. Maps associate values of one type with that of another type.
Methods can be defined for any named types except pointers or interfaces and the receiver doesn't have to be a struct