Structural Design Patterns


In software engineeringstructural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities.
Examples of Structural Patterns include:
  • Adapter pattern: 'adapts' one interface for a class into one that a client expects
    • Retrofit Interface Pattern[1][2]: An adapter used as a new interface for multiple classes at the same time.
    • Adapter pipeline: Use multiple adapters for debugging purposes.[3]
  • Aggregate pattern: a version of the Composite pattern with methods for aggregation of children
  • Bridge pattern: decouple an abstraction from its implementation so that the two can vary independently
    • Tombstone: An intermediate "lookup" object contains the real location of an object.[4]
  • Composite pattern: a tree structure of objects where every object has the same interface
  • Decorator pattern: add additional functionality to a class at runtime where subclassing would result in an exponential rise of new classes
  • Extensibility pattern: aka. Framework - hide complex code behind a simple interface
  • Facade pattern: create a simplified interface of an existing interface to ease usage for common tasks
  • Flyweight pattern: a high quantity of objects share a common properties object to save space
  • Proxy pattern: a class functioning as an interface to another thing
  • Pipes and filters: a chain of processes where the output of each process is the input of the next
  • Private class data pattern: restrict accessor/mutator access

Introduction To Hive Hadoop

Hive is a powerful data warehousing application built on top of Hadoop which allows you to use SQL to access your data. This lecture will give an overview of Hive and the query language. This lecture includes a work-along exercise. The next video is a screencast of a user performing this exercise.

Cloudera Hadoop Training: Introduction to Hive from Cloudera on Vimeo.

Google URL Shortener - goo.gl

Today, I have just used the Google url shortener named "goo.gl". Like other Google products, it has a very simple, attractive user interface. The project is still beta, and Google will probably add more features in the future.

Fore more information: vist goo.gl

SOA Principles - Service Abstraction Principle


In SOA, by keeping specific details hidden, we protect the integrity of the relationship formed between a service and its consumers. Using abstraction, we allow the service business logic and its underlying implementation to evolve over time while continuing to fulfill its duties in relation to what was originally published in the service's contract.

In the real world, abstraction is really existed; For instance, when you want to buy a car, you don’t need to know everything about the engine and its internal components. Why? Because it will confuse you. Hiding unnecessary information from the buyer protects and simplifies the selling process. In SOA, the scenario is quite similar except we don’t have cars to sell, we have services to publish.

Why Service Abstraction is Needed?

The more details we publish in a service contract, the deeper coupling between service and consumers can become. Or in other words, less Abstraction means that the consumers are more awareness of the underlying service logic, technologies, and internal details of the service. Consequently, the service consumers will naturally judge on the service based on the metadata or extra information.

Another reason why Abstraction is required is to empower the service providers the freedom to enhance their services. By abstracting the implementation details from the service contract, the service provider can modify the underline logic without effecting the coupling between the published service and its consumers.


Design Characteristics

Providers hide unnecessary information (underlying technology, logic, internal constrains, etc) from the service consumers. The information altogether is hidden in a particular environment that may be accessed by the internal members of the service's organization.

Requirements

Providers need to spend more time on the design phase to concisely define the interaction requirements and public service constrains. This process can be integrated with a governance methodology.

Types of Metadata

In order to abstract non-essential metadata, we need to classify them first. Generally, there are four types of metadata in service oriented architecture:
Technology metadata
the metadata that declares the implementation technology of the service. Abstracting the technical metadata from the service contract reduces technology-to-contract coupling. An example of technology metadata is the underline implementation technology of the service such as "this service has been built using .Net technology and for implementation we used Visual Studio 2005".

However, some technical metadata are required to be published. For instance, How the service can be invoked?  What technology required to invoke the service? Is it SOAP or REST? Publishing these details does not affect the integrity of coupling. It just guides the consumers.



Systematic Logic metadata
The metadata that explains the underline logic and how it maintains its goals and capabilities. The underline design details (such as logging details, algorithms, database drivers, etc) are usually hidden from the service consumer. Without abstracting this metadata, a service consumer can easily become coupled to the low-level implementation of the service. Consequently, the service publisher may not be abile to modify or adjust the internal implementation.


Functional metadata
The metadata that explains the functional scope of the service. A function scope determines  service's capabilities that are made publicly available through the service contract. In OOP, API often abstracts and maintains a set of generic functions  considered those most likely to be used to clients that may need to develop an application capable of connecting with the product,  In SOA, the technical contract is the service API.



Quality of Service metadata
In the field of computer science, the Quality of Service (QaS) term refers to resource reservation control mechanisms rather than the achieved service quality. Similarly, In SOA, it refers to the behavioral, runtime polices, reliability-related information about the service.

Web service policies are a common form of service description document that explains the QaS of the XML service. Depending on the runtime environment and the capabilities of the hosting service provider, the qulity of service metadata may need to be placed in the non-technical service document. or SLA (Service Level Agreement).

Like other metadata, it is a good idea to publish some of the Quality of Service metadata to the service consumer. An example of the Quality of Service metadata is 'the availability of the service' as shown:

WebP, a new image format for the Web


As part of Google’s initiative to make the web faster, over the past few months we have released a number of tools to help site owners speed up their websites. We launched the Page Speed Firefox extension to evaluate the performance of web pages and to get suggestions on how to improve them, we introduced the Speed Tracer Chrome extension to help identify and fix performance problems in web applications, and we released a set of closure tools to help build rich web applications with fully optimized JavaScript code. While these tools have been incredibly successful in helping developers optimize their sites, as we’ve evaluated our progress, we continue to notice a single component of web pages is consistently responsible for the majority of the latency on pages across the web: images.

Most of the common image formats on the web today were established over a decade ago and are based on technology from around that time. Some engineers at Google decided to figure out if there was a way to further compress lossy images like JPEG to make them load faster, while still preserving quality and resolution. As part of this effort, we are releasing a developer preview of a new image format, WebP, that promises to significantly reduce the byte size of photos on the web, allowing web sites to load faster than before.

Images and photos make up about 65% of the bytes transmitted per web page today. They can significantly slow down a user’s web experience, especially on bandwidth-constrained networks such as a mobile network. Images on the web consist primarily of lossy formats such as JPEG, and to a lesser extent lossless formats such as PNG and GIF. Our team focused on improving compression of the lossy images, which constitute the larger percentage of images on the web today.

To improve on the compression that JPEG provides, we used an image compressor based on the VP8 codec that Google open-sourced in May 2010. We applied the techniques from VP8 video intra frame coding to push the envelope in still image coding. We also adapted a very lightweight container based on RIFF. While this container format contributes a minimal overhead of only 20 bytes per image, it is extensible to allow authors to save meta-data they would like to store.

While the benefits of a VP8 based image format were clear in theory, we needed to test them in the real world. In order to gauge the effectiveness of our efforts, we randomly picked about 1,000,000 images from the web (mostly JPEGs and some PNGs and GIFs) and re-encoded them to WebP without perceptibly compromising visual quality. This resulted in an average 39% reduction in file size. We expect that developers will achieve in practice even better file size reduction with WebP when starting from an uncompressed image.

To help you assess WebP’s performance with other formats, we have shared a selection of open-source and classic images along with file sizes so you can visually compare them on this site. We are also releasing a conversion tool that you can use to convert images to the WebP format. We’re looking forward to working with the browser and web developer community on the WebP spec and on adding native support for WebP. While WebP images can’t be viewed until browsers support the format, we are developing a patch for WebKit to provide native support for WebP in an upcoming release of Google Chrome. We plan to add support for a transparency layer, also known as alpha channel in a future update.

We’re excited to hear feedback from the developer community on our discussion group, so download the conversion tool, try it out on your favorite set of images, and let us know what you think.

Posted by Richard Rabbat, Product Manager