Showing posts with label reading. Show all posts
Showing posts with label reading. Show all posts

Monday, August 6, 2007

Croosing chasms

Crossing Chasms: a pattern language for OO application frameworks.
Brown, K. and Whitenack, B.
Vlissides, J et al (eds), Pattern Languages of program design.

This paper deals with many issues with relation mappings to OO systems. This is a major issue in current real time OO centric systems. The paper concentrates on static mappings, that is how the objects map to tables and vice versa.
many of the issues raised come from basic DB theory and going from first Backus Normal form etc. Allot of the paper deals with the best way to deal with relationships and map these things from a design standpoint. Allot of this is hidden is we use something like Hibernate.
However we will return to this paper after we do some more things on Hibernate. However some key points to note:
  • Look at the way objects map to the DB early so this mapping has some significant effect.
  • Ensure you spend time with the database and map the relationships like you would when you going from 1st order through to 4th order BN.
  • You will need to give every object some unique key, in order to make the relational world happy, that is everything will need some form of primary key, and this will help to amp relationships (from simple 1 : 1 to inheritance mappings).
  • You will need to have some idea about the way the database stores primitive types so you know what format things will map to.
  • When dealing with the issues of relationships you should use direct access (i.e. pointers within the object) rather than relying on the presence of foreign keys which is inherently slow. However ensure that these do exist and are updated to ensure that when an object needs to be instantiated it can be.

Frameworks = components + patterns

Johnson, Ralph E
Communications of the ACM. Vol 40, (10) pp. 39 - 42

In order to understand frameworks you must first try and define them. We can define a framework in a computer sense as a reusable design of parts of a system represented by abstract classes. It provides a customizable interface for developers to use.
Frameworks are like components (such as those components in an OLE library) however they are more complex and also you can customise them allot further. A component can be thought as simply code reuse. A framework is more than that, it is actually design use as well.
Frameworks reuse design aspects like a template or a high level schema. The difference is that a framework has been described in a fixed programming language (Java or C++).
Reusing design has its benefits and its own cots. In the long run you can save time and money with Frameworks, however there is always the steep learning curve associated with developing it.
A pattern is a way to describe a solution to a problem in a certain context. Frameworks implement patterns in a specific way. That is they transform context specific ideas into some tangible code that solves a certain problem. For instance MVC is really a pattern, however the way Spring implements MVC can be though more as a framework.
Frameworks are in the middle between pure code reuse or design reuse. The allow us to use design principles and patterns in a language (and hence domain) specific way.