Tuesday, 5 December 2017

GRASP Patterns

GRASP

General responsibility assignment software patterns (or principles), abbreviated GRASP, consist of guidelines for assigning responsibility to classes and objects in object-oriented design.

The different patterns and principles used in GRASP are: controller, creator, indirection, information expert, high cohesion, low coupling, polymorphism, protected variations, and pure fabrication. All these patterns answer some software problem, and these problems are common to almost every software development project. These techniques have not been invented to create new ways of working, but to better document and standardize old, tried-and-tested programming principles in object-oriented design.
Computer scientist Craig Larman states that "the critical design tool for software development is a mind well educated in design principles. It is not UML or any other technology."[1] Thus, GRASP are really a mental toolset, a learning aid to help in the design of object-oriented software.


Controller[edit]

The controller pattern assigns the responsibility of dealing with system events to a non-UI class that represents the overall system or a use case scenario. A controller object is a non-user interface object responsible for receiving or handling a system event.
A use case controller should be used to deal with all system events of a use case, and may be used for more than one use case (for instance, for use cases Create User and Delete User, one can have a single UserController, instead of two separate use case controllers).
It is defined as the first object beyond the UI layer that receives and coordinates ("controls") a system operation. The controller should delegate the work that needs to be done to other objects; it coordinates or controls the activity. It should not do much work itself. The GRASP Controller can be thought of as being a part of the application/service layer [2] (assuming that the application has made an explicit distinction between the application/service layer and the domain layer) in an object-oriented system with common layers in an information system logical architecture.

Creator[edit]

See also: Factory pattern
Creation of objects is one of the most common activities in an object-oriented system. Which class is responsible for creating objects is a fundamental property of the relationship between objects of particular classes.
In general, a class B should be responsible for creating instances of class A if one, or preferably more, of the following apply:
  • Instances of B contain or compositely aggregate instances of A
  • Instances of B record instances of A
  • Instances of B closely use instances of A
  • Instances of B have the initializing information for instances of A and pass it on creation.

High cohesion[edit]

High cohesion is an evaluative pattern that attempts to keep objects appropriately focused, manageable and understandable. High cohesion is generally used in support of low coupling. High cohesion means that the responsibilities of a given element are strongly related and highly focused. Breaking programs into classes and subsystems is an example of activities that increase the cohesive properties of a system. Alternatively, low cohesion is a situation in which a given element has too many unrelated responsibilities. Elements with low cohesion often suffer from being hard to comprehend, hard to reuse, hard to maintain and averse to change.[3]

Indirection[edit]

The indirection pattern supports low coupling (and reuse potential) between two elements by assigning the responsibility of mediation between them to an intermediate object. An example of this is the introduction of a controller component for mediation between data (model) and its representation (view) in the model-view-controller pattern.

Information expert[edit]

Information expert (also expert or the expert principle) is a principle used to determine where to delegate responsibilities. These responsibilities include methods, computed fields, and so on.
Using the principle of information expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.
Information expert will lead to placing the responsibility on the class with the most information required to fulfill it.[4]





Low coupling[edit]

Main article: Loose coupling
Coupling is a measure of how strongly one element is connected to, has knowledge of, or relies on other elements. Low coupling is an evaluative pattern that dictates how to assign responsibilities to support:
  • lower dependency between the classes,
  • change in one class having lower impact on other classes,
  • higher reuse potential.

Polymorphism[edit]

According to polymorphism principle, responsibility of defining the variation of behaviors based on type is assigned to the type for which this variation happens. This is achieved using polymorphic operations. The user of the type should use polymorphic operations instead of explicit branching based on type.

Protected variations[edit]

The protected variations pattern protects elements from the variations on other elements (objects, systems, subsystems) by wrapping the focus of instability with an interface and using polymorphism to create various implementations of this interface.

Pure fabrication[edit]

A pure fabrication is a class that does not represent a concept in the problem domain, specially made up to achieve low coupling, high cohesion, and the reuse potential thereof derived (when a solution presented by the information expert pattern does not). This kind of class is called a "service" in domain-driven design.

DRY and KISS Software Development Principles

In software engineering, don't repeat yourself (DRY) is a principle of software development aimed at reducing repetition of software patterns, replacing them with abstractions; and several copies of the same data, using data normalization to avoid redundancy.


The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system". The principle has been formulated by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. They apply it quite broadly to include "database schemas, test plans, the build system, even documentation". When the DRY principle is applied successfully, a modification of any single element of a system does not require a change in other logically unrelated elements. Additionally, elements that are logically related all change predictably and uniformly, and are thus kept in sync.
DRY vs WET solutions


Violations of DRY are typically referred to as WET solutions, which is commonly taken to stand for either "write everything twice", "we enjoy typing" or "waste everyone's time". WET solutions are common in multi-tiered architectures where a developer may be tasked with, for example, adding a comment field on a form in a web application. The text string "comment" might be repeated in the label, the HTML tag, in a read function name, a private variable, database DDL, queries, and so on. A DRY approach eliminates that redundancy by leveraging frameworks that reduce or eliminate all those edit tasks excepting the most important one, leaving the extensibility of adding new knowledge variables in one place.


KISS is an acronym for "Keep it simple, stupid" as a design principle noted by the U.S. Navy in 1960. The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore simplicity should be a key goal in design and unnecessary complexity should be avoided. Variations on the phrase include "Keep it Simple, Silly", "keep it short and simple", "keep it simple and straightforward" and "keep it small and simple".

SOLID principles

Single responsibility principle

a class should have only a single responsibility (i.e. changes to only one part of the software's specification should be able to affect the specification of the class).

Open/closed principle

“software entities … should be open for extension, but closed for modification.”

Liskov substitution principle

“objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.” See also design by contract.

Interface segregation principle

“many client-specific interfaces are better than one general-purpose interface.”

Dependency inversion principle

one should “depend upon abstractions, [not] concretions.”

Zasada odwracania zależności składa się z dwóch następujących części:
  1. Moduły wysokopoziomowe nie powinny zależeć od modułów niskopoziomowych. Obie grupy modułów powinny zależeć od abstrakcji.
  2. Abstrakcje nie powinny zależeć od szczegółowych rozwiązań. To szczegółowe rozwiązania powinny zależeć od abstrakcji.
Jeśli chodzi o zależność od abstrakcji, można to zamknąć w jednej prostej formule: pisany przez nas kod nie powinien być uzależniony od konkretnej klasy, zależności takie powinny kończyć się na klasach abstrakcyjnych bądź interfejsach. Zasadę zależności od abstrakcji (ang. depend on abstractions) można również streścić w trzech prostych punktach:
  • Żadna zmienna nie powinna zawierać referencji do konkretnej klasy.
  • Żadna klasa nie powinna dziedziczyć po konkretnej klasie.
  • Żadna metoda nie powinna przykrywać metody zaimplementowanej w którejkolwiek z klas bazowych.
  • Podstawowymi zaletami zasady odwracania zależności jest to, że właściwe jej stosowanie jest kluczowe, jeśli chcemy tworzyć frameworki wielokrotnego użytku. Ma ona również duży wpływ na odporność kodu źródłowego na przyszłe zmiany, ponieważ zgodnie z tą zasadą abstrakcje, a także szczegółowe mechanizmy są od siebie odizolowane, co z kolei wpływa na to, że tworzony kod jest dużo prostszy w konserwacji.
Code examples of SOLID principles for JavaScript
https://gist.github.com/Crizstian/ba39c6fdbb30a40c738e3c07ea83b5c1



Wednesday, 26 December 2012

Audyt SEO


Audyt seo jest niezbędnym elementem procesu projektowania i pozycjonowania strony internetowej. W trakcie audytu szczegółowo analizujemy 5 głównych obszarów:

  1. Accessibility
  2. Indexability
  3. On-Page Ranking Factors
  4. Off-Page Ranking Factors
  5. Competitive Analysis

Kompletny audyt zawiera analizę ponad 300 czynników, które wpływają na pozycję Twojej strony w rankingu wyszukiwarek. Do jego sporządzenia używamy kilkunastu profesjonalnych narzędzi do analizy seo. Bądź bardziej widoczny, zmiejsz koszty – nie zwlekaj, zapytaj o szczegóły.


1. Accessibility

Accessibility to miara dostępności witryny i informacji w niej zawartych dla odwiedzającego.

  • Site Architecture
  • Site Navigation
  • Site Performance
  • Robots.txt
  • Robots Meta Tags
  • HTTP Status Codes
  • XML Sitemap

2. Indexability

Indexability to miara zdolności witryny do bycia pobraną i zindeksowaną przez roboty wyszukiwarek.

  • Hosting
  • Server uptime
  • Site: Command
  • Index Sanity Checks
  • Page Searches
  • Brand Searches
  • Search Engine Penalties

3. On-Page Ranking Factors

Wewnętrzne czynniki wpływające na pozycję witryny w rankingu wyszukiwarek.

  • URLs
  • Content
  • Structure / Internal linking
  • Titles
  • Images / Media
  • Outlinks
  • HTML Code

4. Off-Page Ranking Factors

Zewnętrzne czynniki wpływające na pozycję witryny w rankingu wyszukiwarek.

  • Authority
  • Popularity
  • Backlink profile
  • Social Engagement

5. Competitive Analysis

Im więcej wiesz o konkurencji, tym łatwiej zindetyfikujesz swoje słabe punkty.

  • Keywords
  • Overall Page Quality
  • Backlink profile


Friday, 23 November 2012

Projektowanie stron, pozycjonowanie - Katowice, Sosnowiec, Będzin

Strona kierowana jest do tych, którzy rozumieją wartość marketingu internetowego i wiedzą jak mierzyć tę wartość. Do tych, którzy zastanawiają się jak działa ta technologia, jaką strategię wybrać dla firmy, organizacji, strony internetowej. Nie ma tu gotowych rozwiązań, jest to miejsce gdzie możesz zapytać kogoś, kto ma doświadczenie i od wielu lat robi dokładnie to, co Ty zamierzasz robić.

Zapraszam na moją stronę: Projektowanie stron, pozycjonowanie - Katowice, Sosnowiec, Będzin

Sunday, 18 November 2012

Miłosz Szarek @ Picasa


Picasa is an image organizer and image viewer for organizing and editing digital photos, plus an integrated photo-sharing website, originally created by a company named Lifescape (which at that time may have resided at Idealab) in 2002 and owned by Google since 2004. “Picasa” is a blend of the name of Spanish painter Pablo Picasso, the phrase mi casa (Spanish for “my house”) and “pic” for pictures (personalized art). In July 2004, Google acquired Picasa from its original author and began offering it as freeware.
For organizing photos, Picasa has file importing and tracking features, as well as tags, facial recognition, and collections for further sorting. It also offers several basic photo editing functions, including color enhancement, red eye reduction, and cropping. Other features include slide shows, printing, and image timelines. Images can also be prepared for external use, such as for e-mailing or printing, by reducing file size and setting up page layouts. There is also integration with online photo printing services. Other simple editing features include adding text to the image. Picasa supports Google’s WebP image format as well as the JPG format and most Raw image format (RAW files). A user can view and edit RAW files and save the finished edit (as JPG, or other forms) without any changes to the original RAW file.

Monday, 5 November 2012

Miłosz Szarek @ Tumblr


Tumblr is a microblogging platform and social networking website, owned and operated by Tumblr, Inc. The service allows users to post multimedia and other content to a short-form blog. Users can follow other users’ blogs, as well as make their blogs private. Much of the website’s features are accessed from the “dashboard” interface, where the option to post content and posts of followed blogs appear.
As of October 13, 2012, Tumblr has over 77 million blogs. According to comScore, it scored 13.4 million unique visitors in the United States alone in July 2011—up 218% from July 2010. Its headquarters is located in Midtown Manhattan, New York City.
As of August 20, 2012, Tumblr has over 69.4 million blogs and more than 29.8 billion total posts. As of September 2011, the website receives more than 13 billion views per month. As of July 2010, the site receives 25,000 new users each day and as of July 2012, 71.6 million posts are created on the site each day. An analysis by AddThis of shares through their service in 2011 noted that Tumblr sharing had increased by 1299.5%.
The service is most popular with the teen and college-aged user segments with half of Tumblr’s visitor base being under the age of 25. As of 2009, Tumblr had an 85% retention rate, compared with 40% for Twitter.
Miłosz Szarek @ Tumblr

Miłosz Szarek @ Wordpress.com

Miłosz Szarek @ Wordpress.com

Miłosz Szarek @ Goldenline

Miłosz Szarek @ Goldenline

Miłosz Szarek @ Myspace


Myspace is a social networking service owned by Specific Media LLC and pop music singer and actor Justin Timberlake. Myspace was launched in August 2003 and is headquartered in Beverly Hills, California. In June 2012, Myspace had 25 million unique U.S. visitors.
Myspace was founded in 2003 and was acquired by News Corporation in July 2005 for $580 million. From 2005 until early 2008, Myspace was the most visited social networking site in the world, and in June 2006 surpassed Google as the most visited website in the United States. In April 2008, Myspace was overtaken by Facebook in the number of unique worldwide visitors, and was surpassed in the number of unique U.S. visitors in May 2009, though Myspace generated $800 million during the 2008 fiscal year. Since then, the number of Myspace users has declined steadily in spite of several redesigns. As of June 2012, Myspace was ranked 161st by total web traffic.
MySpace had a significant influence in pop culture and music and created a gaming platform that launched the successes of Zynga and Rock You, among others. The site also started the trend of creating unique URLS for companies and artists.
Miłosz Szarek @ Myspace

Miłosz Szarek @ Flavors.me

Miłosz Szarek @ Flavors.me

Miłosz Szarek @ Pinterest

Pinterest is a pinboard-style social photo sharing website that allows users to create and manage theme-based image collections such as events, interests, hobbies, and more. Users can browse other pinboards for inspiration, 're-pin' images to their own collections or 'like' photos. Pinterest users can upload, save, sort and manage images, known as pins, and other media content (i.e. videos) through collections known as pinboards. Pinboards are generally themed so that pins can easily be organized, categorized and discovered by other users. Pinterest acts as a personalized media platform, whereby your own content as well as anyone else's uploaded pins can be browsed on the main page. Users can then save their favourite pins to one of their own boards using the "Pin It" button. Content can also be found outside of Pinterest and similarly uploaded to a board via the "Pin It" button which can be downloaded to the bookmark bar on a web browser, or be implemented by a webmaster directly on the website.

Miłosz Szarek @ Pinterest

Miłosz Szarek @ StumbleUpon


StumbleUpon is a discovery engine (a form of web search engine) that finds and recommends web content to its users. Its features allow users to discover and rate Web pages, photos, and videos that are personalized to their tastes and interests using peer-sourcing and social-networking principles. Toolbar versions exist for Firefox, Google Chrome, Opera and Internet Explorer, but StumbleUpon also works with some independent Mozilla-based browsers. It also works with Safari. Native mobile StumbleUpon apps exist for iOS, Android, and the Amazon Appstore.
StumbleUpon uses collaborative filtering (an automated process combining human opinions with machine learning of personal preference) to create virtual communities of like-minded Web surfers. Rating Web sites update a personal profile (a blog-style record of rated sites) and generate peer networks of Web surfers linked by common interest. These social networks coordinate the distribution of Web content, so that users “stumble upon” pages explicitly recommended by friends and peers. Giving a site a thumbs up results in the site being placed under the user’s “favorites”.
Users rate a site by giving it a thumbs up, thumbs down selection on the StumbleUpon toolbar, and can optionally leave additional commentary on the site’s review page, which also appears on the user’s blog. This social content discovery approach automates the “word-of-mouth” referral of peer-approved Web sites and simplifies Web navigation.

Miłosz Szarek @ StumbleUpon

Miłosz Szarek @ About.me

Miłosz Szarek @ About.me

Miłosz Szarek @ YouTube


YouTube is a video-sharing website, created by three former PayPal employees in February 2005, on which users can upload, view and share videos. The company is based in San Bruno, California, and uses Adobe Flash Video and HTML5 technology to display a wide variety of user-generated video content, including movie clips, TV clips, and music videos, as well as amateur content such as video blogging and short original videos.
Most of the content on YouTube has been uploaded by individuals, although media corporations including CBS, the BBC, VEVO, Hulu, and other organizations offer some of their material via the site, as part of the YouTube partnership program.
YouTube, by providing a video hosting service, has been involved with popularizing Internet trends in popular culture. Its users represent of society and it is part of a set of social networking sites that people and organizations often maintain a presence on. YouTube has created some internet celebrities in its own right. It has been recognized and honored as a global archive and bulletin board of socially valuable video messages. Some aspects of how the site operates, such as its video ranking system, have sometimes been the subject of criticism as users vie to achieve a maximum number of views for their videos.

Miłosz Szarek @ YouTube

Miłosz Szarek @ Flickr

Flickr (stylized as flickr) is an image hosting and video hosting website, web services suite, and online community that was created by Ludicorp in 2004 and acquired by Yahoo! in 2005. In addition to being a popular website for users to share and embed personal photographs, the service is widely used by bloggers to host images that they embed in blogs and social media. Yahoo reported in June 2011 that Flickr had a total of 51 million registered members and 80 million unique visitors. In August 2011 the site reported that it was hosting more than 6 billion images and this number continues to grow steadily according to reporting sources. Photos and videos can be accessed from Flickr without the need to register an account but an account must be made in order to upload content onto the website. Registering an account also allows users to create a profile page containing photos and videos that the user has uploaded and also grants the ability to add another Flickr user as a contact. For mobile users, Flickr has an official app for iOS, Android, and Windows Phone 7 operating systems. Miłosz Szarek @ Flickr

Miłosz Szarek @ Twitter


Twitter is an online social networking service and microblogging service that enables its users to send and read text-based messages of up to 140 characters, known as “tweets”.
It was created in March 2006 by Jack Dorsey and launched that July. The service rapidly gained worldwide popularity, with over 500 million active users as of 2012, generating over 340 million tweets daily and handling over 1.6 billion search queries per day. Since its launch, Twitter has become one of the top 10 most visited websites on the Internet, and has been described as “the SMS of the Internet. Unregistered users can read tweets, while registered users can post tweets through the website interface, SMS, or a range of apps for mobile devices.
Tweets are publicly visible by default; however, senders can restrict message delivery to just their followers. Users can tweet via the Twitter website, compatible external applications (such as for smartphones), or by Short Message Service (SMS) available in certain countries. Users may subscribe to other users’ tweets – this is known as following and subscribers are known as followers or tweeps (Twitter + peeps).
Twitter allows users the ability to update their profile by using their mobile phone either by text messaging or by apps released for certain smartphones and tablets.
Twitter has been compared to a web-based Internet Relay Chat (IRC) client.
Miłosz Szarek @ Twitter

Miłosz Szarek @ LinkedIn

Users can create profiles with photos, lists of personal interests, contact information, and other personal information. Users can communicate with friends and other users through private or public messages and a chat feature. One purpose of the site is to allow registered users to maintain a list of contact details of people with whom they have some level of relationship, called Connections. Users can invite anyone (whether a site user or not) to become a connection. A contact network is built up consisting of their direct connections, the connections of each of their connections (termed second-degree connections) and also the connections of second-degree connections (termed third-degree connections). This can be used to gain an introduction to someone a person wishes to know through a mutual contact. Users can upload their resume or design their own profile in order to showcase work and community experiences. It can then be used to find jobs, people and business opportunities recommended by someone in one's contact network. Employers can list jobs and search for potential candidates. Job seekers can review the profile of hiring managers and discover which of their existing contacts can introduce them. Users can post their own photos and view photos of others to aid in identification. Users can now follow different companies and can get notification about the new joining and offers available. Users can save (i.e. bookmark) jobs which they would like to apply for.

Miłosz Szarek @ LinkedIn

Miłosz Szarek @ Facebook

Facebook is a social networking service launched in February 2004, owned and operated by Facebook, Inc. As of September 2012, Facebook has over one billion active users,[6] more than half of them using Facebook on a mobile device. Users must register before using the site, after which they may create a personal profile, add other users as friends, and exchange messages, including automatic notifications when they update their profile. Additionally, users may join common-interest user groups, organized by workplace, school or college, or other characteristics, and categorize their friends into lists such as "People From Work" or "Close Friends". Users can create profiles with photos, lists of personal interests, contact information, and other personal information. Users can communicate with friends and other users through private or public messages and a chat feature. They can also create and join interest groups and "like pages" (called "fan pages" until April 19, 2010), some of which are maintained by organizations as a means of advertising. Facebook has been prompted to add a "third gender", "other", or "intersex" tab in the gender option which contains only male and female. Facebook refused and said that individuals can "opt out of showing their sex on their profile". A 2012 Pew Internet and American Life study identified that between 20–30% of Facebook users are "power users" who frequently link, poke, post and tag themselves and others.

Miłosz Szarek @ Facebook

Thursday, 11 October 2012

Miłosz Szarek @ Google+


Google+ is a multilingual social networking and identity service owned and operated by Google Inc. It was launched in June 28, 2011. As of September 2012, it has a total of 400 million registered users of whom 100 million are active on a monthly basis. Unlike other conventional social networks which are generally accessed through a single website, Google has described Google+ as a “social layer” consisting of not just a single site, but rather an overarching “layer” which covers many of its online properties.
Short guide for marketers:
1. Setup a solid profile.
2. Add relevant and remarkable images.
3. Make sure your profile is OPEN to search.
4. Optimize the links to the right of the profile using keywords.
5. Use “Circles” to communicate with clients, prospects, media, etc.
6. Use +, Comments, and Share to boost relationships.
7. Add videos to your profile.
8. Add your industry or business name as a “Spark”
9. Market research –ask questions and use Hangouts as needed.
10. Get a custom URL to share your Google Plus profile.
Content Marketing tactics using G+:
1. Sharing of Circles
2. Creative Hang-outs
3. Lead with G+, auto-post to FB and Twitter
4. Curated Content
5. Authentic Presence
Miłosz Szarek @ Google+