Internet application development - Dariusz Harpula

Tuesday, February 27, 2007

Ruby, Ruby on Rails, PHP on Trax

[RUBY]

Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan and CLU. Ruby is a single-pass interpreted language. Its main implementation is free software. Ruby is said to follow the principle of least surprise (POLS), meaning that the language should behave in such a way as to minimize confusion for experienced users. Ruby is object-oriented: every bit of data is an object, even classes and types that many other languages designate as primitives (such as integers, booleans, and "nil"). Every function is a method. Named values (variables) always designate references to objects, not the objects themselves. Ruby supports inheritance with dynamic dispatch, mixins and singleton methods (belonging to, and defined for, a single instance rather than being defined on the class).
Though Ruby does not support multiple inheritance, classes can import modules as mixins. Procedural syntax is supported, but all methods defined outside of the scope of a particular object are actually methods of the Object class. Since this class is parent to every other class, the changes become visible to all classes and objects.

EXAMPLES:

Hello world example:

puts 'hello world'


Class example:

class Person
def initialize(name, age)
@name, @age = name, age
end

def <=>(person)
@age <=> person.age
end

def to_s
"#{@name} (#{@age})"
end

attr_reader :name, :age
end

group = [ Person.new("John", 20),
Person.new("Markus", 63),
Person.new("Ash", 16)
]

puts group.sort.reverse


Comparison between PHP and Ruby:

PHP Code:
$item) { echo "$index. $item"; }
?>


RUBY Code:
<% array = ['my list', 'of', 'items'] array.each_with_index { |item, index| p "#{index}. #{item}" } %>

[Ruby on Rails]

Ruby on Rails is a web application framework released in 2004 that aims to increase the speed and ease of web development. Often shortened to Rails, or RoR, it is an open source project written in the Ruby language. Like many contemporary web frameworks, Rails uses the Model-View-Controller (MVC) architecture for organizing applications. This pattern splits the view (also called the presentation) into "dumb" templates that are primarily responsible for inserting pre-built data in between HTML tags. The model contains the "smart" domain objects (such as Account, Product, Person, Post) that holds all the business logic and knows how to persist themselves to a database. The controller handles the incoming requests (such as Save New Account, Update Product, Show Post) by manipulating the model and directing data to the view. In Rails, the model is handled by what‘s called an object-relational mapping layer entitled Active Record. This layer allows you to present the data from database rows as objects and embellish these data objects with business logic
methods. The controller and view are handled by the Action Pack, which handles both layers by its two parts: Action View and Action Controller. These two layers are bundled in a single package due to their heavy interdependence. This is unlike the relationship between the Active Record and Action Pack that is much more separate. Each of these packages can be used independently outside of Rails.
Ruby on Rails strives for applications with less code, through guiding principles that include "Don't repeat yourself" (code should never be redundant) and "Convention over configuration" (programmers only need to specify when their setup differs from the norm). Rails provides out-of-the-box scaffolding, which can quickly construct most of the logic and views needed for a basic website, the WEBrick web server and other helpful development tools.

Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all pre-configured and ready to run. It does not modify system environment. Current release of Instant Rails is for Windows, but there are plans for ports to Linux, BSD, and OSX.

[Php On Trax]

Php On Trax (formerly Php On Rails) is a web-application and persistance framework that is based on Ruby on Rails and includes everything needed to create database-backed web-applications according to the Model-View-Control pattern of separation.


PHP on Trax example:
title == '')
return array(false, "Title can't be empty");
if ($this->find_first("title = '{$this->title}'") != false)
return array(false, "Title must be unique");
return array(true);
}
public function validate_description() {
if ($this->description == '')
return array(false, "Description can't be empty");
return array(true);
}
public function salable_items() {
return $this->find_all("date_available <= now()", "date_available desc"); } } ?>


Ruby on Rails example:
<% class Product < message =""> "Title can't be empty"
validates_uniqueness_of :title, :message => "Title must be unique"
validates_presence_of :description, :message => "Description can't be blank"
def salable_items
Product.find(:all, :conditions => 'date_available <= now()', :order => 'date_available desc')
end
end
%>


References:
http://en.wikipedia.org/wiki/Ruby_programming_language
http://en.wikipedia.org/wiki/Ruby_on_Railss
http://api.rubyonrails.org/
http://www.phpontrax.com/

System Planning Processes [SWOT] [VCM] [BPR] [ISA]

[SWOT]

SWOT Analysis is a strategic planning tool used to evaluate the Strengths, Weaknesses, Opportunities, and Threats involved in a project or in a business venture or in any other situation of an organization or individual requiring a decision in pursuit of an objective. It involves monitoring the marketing environment internal and external to the organization or individual.

SWOT Analysis Wal-Mart

Strengths.

* Wal-Mart is a powerful retail brand. It has a reputation for value for money, convenience and a wide range of products all in one store.
* Wal-Mart has grown substantially over recent years, and has experienced global expansion (for example its purchase of the United Kingdom based retailer ASDA).
* The company has a core competence involving its use of information technology to support its international logistics system. For example, it can see how individual products are performing country-wide, store-by-store at a glance. IT also supports Wal-Mart's efficient procurement.
* A focused strategy is in place for human resource management and development. People are key to Wal-Mart's business and it invests time and money in training people, and retaining a developing them.

Weaknesses.

* Wal-Mart is the World's largest grocery retailer and control of its empire, despite its IT advantages, could leave

it weak in some areas due to the huge span of control.
* Since Wal-Mart sell products across many sectors (such as clothing, food, or stationary), it may not have the

flexibility of some of its more focused competitors.
* The company is global, but has has a presence in relatively few countries Worldwide.

Opportunities.

* To take over, merge with, or form strategic alliances with other global retailers, focusing on specific markets such as Europe or the Greater China Region.
* The stores are currently only trade in a relatively small number of countries. Therefore there are tremendous opportunities for future business in expanding consumer markets, such as China and India.
* New locations and store types offer Wal-Mart opportunities to exploit market development. They diversified from large super centres, to local and mall-based sites.
* Opportunities exist for Wal-Mart to continue with its current strategy of large, super centres.

Threats.

* Being number one means that you are the target of competition, locally and globally.
* Being a global retailer means that you are exposed to political problems in the countries that you operate in.
* The cost of producing many consumer products tends to have fallen because of lower manufacturing costs.

Manufacturing cost have fallen due to outsourcing to low-cost regions of the World. This has lead to price competition, resulting in price deflation in some ranges. Intense price competition is a threat.

'Wal-Mart Stores, Inc. is the world's largest retailer, with $256.3 billion in sales in the fiscal year ending Jan. 31, 2004. The company employs 1.6 million associates worldwide through more than 3,600 facilities in the United States and more than 1,570 units . . .more? Go to Wal-Mart Facts


[Value Chain Model]

The value chain is a concept from business management that was first described and popularized by Michael Porter in his 1985 best-seller, Competitive Advantage: Creating and Sustaining Superior Performance.The value chain categorizes the generic value-adding activities of an organization. The "primary activities" include: inbound logistics, operations (production), outbound logistics, marketing and sales, and services (maintenance). The "support activities" include: administrative infrastructure management, human resource management, R&D, and procurement. The costs and value drivers are identified for each value activity. The value chain framework quickly made its way to the forefront of management thought as a powerful analysis tool for strategic planning. Its ultimate goal is to maximize value creation while minimizing costs.
To better understand the activities through which a firm develops a competitive advantage and creates shareholder value, it is useful to separate the business system into a series of value-generating activities referred to as the value chain. In his 1985 book Competitive Advantage, Michael Porter introduced a generic value chain model that comprises a sequence of activities found to be common to a wide range of firms. Porter identified primary and support activities as shown in the following diagram





The Value Chain framework of Michael Porter is a model that helps to analyze specific activities through which firms can create value and competitive advantage.

Inbound Logistics

Includes receiving, storing, inventory control, transportation scheduling.

Operations


Includes machining, packaging, assembly, equipment maintenance, testing and all other value-creating activities thattransform the inputs into the final product.

Outbound Logistics

The activities required to get the finished product to the customers: warehousing, order fulfillment, transportation,distribution management.

Marketing and Sales

The activities associated with getting buyers to purchase the product including channel selection, advertising,promotion, selling, pricing, retail management, etc.

Service

The activities that maintain and enhance the product's value, including customer support, repair services, installation,training, spare parts management, upgrading, etc.

Procurement

Procurement of raw materials, servicing, spare parts, buildings, machines, etc.

Technology Development


Includes technology development to support the value chain activities, such as Research and Development, Processautomation, design, redesign.

Human Resource Management

The activities associated with recruiting, development (education), retention and compensation of employees andmanagers.

Firm Infrastructure

Includes general management, planning management, legal, finance, accounting, public affairs, quality management, etc.



[Business process reengineering]

Business Process Reengineering is a management approach aiming at improvements by means of elevating efficiency andeffectiveness of the processes that exist within and across organizations.In order to achieve the major improvements BPRis seeking for, the change of structural organizational variables, and other ways of managing and performing work is often considered as being insufficient. For being able to reap the achievable benefits fully, the use of informationtechnology (IT) is conceived as a major contributing factor. While IT traditionally has been used for supporting the existing business functions, i.e. it was used for increasing organizational efficiency, it now plays a role as enabler of new organizational forms, and patterns of collaboration within and between organizations.
BPR reached its heyday in the early 1990's when Michael Hammer and James Champy published their best-selling book,"Reengineering the Corporation". The authors promoted the idea that sometimes radical redesign and reorganization of an enterprise (wiping the slate clean) was necessary to lower costs and increase quality of service and that information technology was the key enabler for that radical change. Hammer and Champy felt that the design of workflow in most large corporations was based on assumptions about technology, people, and organizational goals that were no longer valid. They suggested seven principles of reengineering to streamline the work process and thereby achieve significant levels of improvement in quality, time management, and cost:

1. Organize around outcomes, not tasks.
2. Identify all the processes in an organization and prioritize them in order of redesign urgency.
3. Integrate information processing work into the real work that produces the information.
4. Treat geographically dispersed resources as though they were centralized.
5. Link parallel activities in the workflow instead of just integrating their results.
6. Put the decision point where the work is performed, and build control into the process.
7. Capture information once and at the source.

Reengineering Recommendations

* BPR must be accompanied by strategic planning, which addresses leveraging IT as a competitive tool.
* Place the customer at the center of the reengineering effort -- concentrate on reengineering fragmented processes that lead to delays or other negative impacts on customer service.
* BPR must be "owned" throughout the organization, not driven by a group of outside consultants.
* Case teams must be comprised of both managers as well as those will actually do the work.
* The IT group should be an integral part of the reengineering team from the start.
* BPR must be sponsored by top executives, who are not about to leave or retire.
* BPR projects must have a timetable, ideally between three to six months, so that the organization is not in a state of "limbo".
* BPR must not ignore corporate culture and must emphasize constant communication and feedback.

Tools to support BPR
When a BPR project is undertaken across the organization, it can require managing a massive amount of information about the processes, data and systems. If you don't have an excellent tool to support BPR, the management of this information can become an impossible task. The use of a good BPR/documentation tool is vital in any BPR project.

The types of attributes for in BPR software are:

* Graphical interface for fast documentation
* "Object oriented" technology, so that changes to data (eg: job titles) only need to be made in one place, and the change automatically appears throughout all the organization's procedures and documentation.
* Drag and drop facility so you can easily relate organizational and data objects to each step in the process
* Customizable meta data fields, so that you can include information relating to your industry, business sector or organization in your documentation
* Analysis, such as swim-lanes to show visually how responsibilities in a process are transferred between different roles, or where data items or computer applications are used.
* Support for Value Stream mapping.
* CRUD or RACI reports, to provide evidence for process improvement.
* The ability to assess the processes against agreed international standards
* Simulation software to support 'what-if' analyses during the design phase of the project to develop LEAN processes
* The production of word documents or web site versions of the procedures at the touch of a single button, so that the information can be easily maintained and updated.

[Information systems architecture]

John Zachman introduced a framework for information systems architecture (ISA) that has been widely adopted by systems analysts and database designers. It provides a taxonomy for relating the concepts that describe the real world to the concepts that describe an information system and its implementation. The ISA framework has a simple elegance that makes it easy to remember, yet it draws attention to fundamental distinctions that are often overlooked in systems design. Zachman's framework for information systems architecture (ISA) provides a systematic taxonomy of concepts for relating things in the world to the representations in the computer. It is not a replacement for other programming tools, techniques, or methodologies. Instead, it provides a way of viewing a system from many different perspectives and showing how they are all related.

Overview of the framework

When applied to an information system, the word architecture is a metaphor that compares the construction of a computer system to the construction of a house. The ISA framework is an elaboration of that metaphor. It compares the perspectives in describing an information system to the perspectives produced by an architect in designing and constructing a building:

* Scope--The first architectural sketch is a "bubble chart," which depicts in gross terms the size, shape, spatial relationships, and basic purpose of the final structure. In the ISA framework, it corresponds to an executive summary for a planner or investor who wants an estimate of the scope of the system, what it would cost, and how it would perform.

* Enterprise or business model--Next are the architect's drawings that depict the final building from the perspective of the owner, who will have to live with it in the daily routines of business. They correspond to the enterprise (business) model, which constitutes the design of the business and shows the business entities and processes and how they interact.

* System model--The architect's plans are the translation of the drawings into detailed specifications from the designer's perspective. They correspond to the system model designed by a systems analyst who must determine the data elements and functions that represent business entities and processes.

* Technology model--The contractor must redraw the architect's plans to represent the builder's perspective, which must onsider the constraints of tools, technology, and materials. The builder's plans correspond to the technology model, which must adapt the information system model to the details of the programming languages, I/O devices, or other technology.

* Components--Subcontractors work from shop plans that specify the details of parts or subsections. These correspond to the detailed specifications that are given to programmers who code individual modules without being concerned with the overall context or structure of the system.



References:
http://en.wikipedia.org/wiki/SWOT_analysis
http://en.wikipedia.org/wiki/Value_chain
http://marketingteacher.com/SWOT/walmart_swot.htm
http://www.netmba.com/strategy/value-chain/
http://en.wikipedia.org/wiki/Business_process_reengineering
http://www.teamtechnology.co.uk/business-process-reengineering.html
http://searchcio.techtarget.com/sDefinition/0,,sid19_gci536451,00.html
http://www.netlib.com/bpr1.shtml
http://findarticles.com/p/articles/mi_m0ISJ/is_n3_v31/ai_12547744

Labels: , , ,

Monday, February 26, 2007

Functional programming languages

Imperative programming, as contrasted with declarative programming, is a programming paradigm that describes computation as statements that change a program state. In much the same way as the imperative mood in natural languages expresses commands to take action, imperative programs are a sequence of commands for the computer to perform. A commonly used synonym to imperative programming is procedural programming.Imperative programming languages stand in contrast to other
types of languages, such as functional and logical programming languages.

Functional programming is a style of programming that emphasizes the evaluation of expressions, rather than execution of commands. The expressions in these language are formed by using functions to combine basic values. A functional language is a language that supports and encourages programming in a functional style.

Functional programming languages, especially "purely functional" ones, have largely been emphasized in academia rather than in commercial software development. However, notable functional programming languages used in industry and commercial applications include Erlang (concurrent applications),[2] R (statistics), Mathematica (symbolic math),[3] J and K (financial analysis), and domain-specific programming languages like XSLT.[4][5] Important influences on functional programming have been lambda calculus, and the programming languages APL and Lisp, and more recently ML and Haskell.

In an imperative language, one might describe an algorithm for adding values together to get a sum thus:

for (i = 0, sum = 0; i <= 100; i++ ) sum += i;

The functional equivalent would be expressed without any variable updates (e.g. operations upon whose side-effects the process depends), perhaps as:

Sum[1..100];

Major benefits of functional programming include that: *By trying to eliminate side-effects, it makes more explicit the relationship between input and output. Code is more readily understood. *Since it describes inputs and outputs rather than the detail of algorithms, more code optimizing can be readily done. This is of particular value when trying to build programs to run on parallel computing architectures.

EXAMPLES:
[F#]


Combining the efficiency, scripting, strong typing and productivity of ML with the stability, libraries, cross-language working and tools of .NET.

F# is a programming language that provides combination of type safety, performance and scripting, with all the advantages of running on a high-quality, well-supported modern runtime system. F# gives you a combination of

* interactive scripting like Python,
* the foundations for an interactive data visualization environment like MATLAB,
* the strong type inference and safety of ML,
* a cross-compiling compatible core shared with the popular OCaml language,
* a performance profile like that of C#,
* easy access to the entire range of powerful .NET libraries and database tools,
*a foundational simplicity with similar roots to Scheme,
*the option of a top-rate Visual Studio integration,
* the experience of a first-class team of language researchers with a track record of delivering high-quality implementations,
*the speed of native code execution on the concurrent, portable, and distributed .NET Framework.


F# is a pragmatically-oriented variant of ML that shares a core language with OCaml. F# programs run on top of the .NET Framework. Unlike other scripting languages it executes at or near the speed of C# and C++, making use of the performance that comes through strong typing. Unlike many statically-typed languages it also supports many dynamic language techniques, such as property discovery and reflection where needed. F# includes extensions for working across languages and for object-oriented programming, and it works seamlessly with other .NET programming languages and tools.


[OCaml]

Caml is a general-purpose programming language, designed with program safety and reliability in mind. It is very expressive, yet easy to learn and use. Caml supports functional, imperative, and object-oriented programming styles.The Caml language has been developed since 1985 at INRIA by the Formel and Cristal teams. Caml Light, which was eveloped in the early 1990s, is still in use today, especially in education. Objective Caml offers a richer programming language as well as efficient native code compilers for many architectures.

Strengths:

* A powerful type system, equipped with parametric polymorphism and type inference. For instance, the type of a collection can be parameterized by the type of its elements. This allows defining some operations over a collection independently of the type of its elements: sorting an array is one example. Furthermore, type inference allows defining such operations without having to explicitly provide the type of their parameters and result.
* User-definable algebraic data types and pattern matching. New algebraic data types can be defined as combinations of records and sums. Functions that operate over such data structures can then be defined by pattern matching, a generalized form of the well-known switch statement, which offers a clean and elegant way of simultaneously examining and naming data.
* Automatic memory management, thanks to a fast, unobtrusive, incremental garbage collector.
* Separate compilation of stand-alone applications. Portable bytecode compilers allow creating stand-alone applications out of Caml Light or Objective Caml programs. A foreign function interface allows Caml code to interoperate with C code when necessary. Interactive use of Caml is also supported via a “read-evaluate-print” loop.
* A sophisticated module system, which allows organizing modules hierarchically and parameterizing a module over a number of other modules.
* An expressive object-oriented layer, featuring multiple inheritance and parametric classes.
* Efficient native code compilers. In addition to its bytecode compiler, Objective Caml offers a compiler that produces efficient machine code for many architectures.




F# compared with OCaml

Feature

F#

OCaml

Unicode strings and wide chars

Yes


Functions as values

Yes

Yes

Discriminated unions

Yes

Yes

Generics/
Type parameters

Yes

Yes

"Interior" bindings

Yes

Yes

Records

Yes

Yes

Pattern matching

Yes

Yes

Type aliases

Yes

Yes

Modules

Yes

Yes

Module Signatures

Yes

Yes

Nested Modules

Yes

Yes

Namespaces

Yes


Strong-named assemblies

Yes


Inheritance (authoring)

Yes

Yes

Object expressions

Yes

Yes

Structural subtyping constraints


Yes

Nominal subtyping constraints

Yes


Structured classes


Yes

Variance on type parameters


Yes

Labelled Arguments


Yes

Default parameters


Yes

"Printf" style formatting

Yes

Yes

Operator Overloading

Yes


Functors


Yes








References:
http://www.cbbrowne.com/info/functional.html
http://en.wikipedia.org/wiki/Imperative_programming
http://en.wikipedia.org/wiki/Functional_programming
http://research.microsoft.com/fsharp/language-compare.aspx
http://research.microsoft.com/fsharp/fsharp.aspx

Labels:

Wednesday, October 25, 2006

Is RSS legal ?

- Copyrights
- republish rights

Wednesday, October 18, 2006

RSS Aggregator Google Reader

RSS References

http://blogs.law.harvard.edu/tech/rss
http://www.xml.com/pub/a/2002/12/18/dive-into-xml.html XML.com: What Is RSS
http://www.techxtra.ac.uk/rss_primer/ RSS - A Primer for Publishers and Content Providers
http://en.wikipedia.org/wiki/RSS_(file_format)
http://goatee.net/2003/rss-history.html
http://www.xml.com/pub/a/2002/12/18/dive-into-xml.htmlhttp://www.xml.com/pub/a/2002/12/18/dive-into-xml.html
http://www.techxtra.ac.uk/rss_primer/


RSS Aggregators NewzCrawler

RSS Formats

Resource Description Framework (RDF) - general method of modeling knowledge
Dublin Core - provides a simple and standardised set of conventions for describing things online in ways that make them easier to find
CDF - Channel Definition Format (CDF) is an XML standard used in conjunction with Microsoft Active Channel and Smart Offline Favorites technologies. Its use is to define a website's content and structure
XML-RPC - XML-RPC is a remote procedure call protocol which uses XML to encode its calls and HTTP as a transport mechanism
OPML - (Outline Processor Markup Language) is an XML format for outlines. Originally developed by Radio UserLand as a native file format for an outliner application, it has since been adopted for other uses, the most common being to exchange lists of RSS feeds between RSS aggregators.
ATOM - The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (APP for short) is a simple HTTP-based protocol for creating and updating Web resources.
The development of Atom was motivated by the existence of many incompatible versions of the RSS syndication format

RSS File Format

File extension: .rss
.xml
MIME type: application/rss+xml
Type code: TEXT
Extended from: XML

RSS Acronym

Really Simple Syndication (RSS 2.0)
Rich Site Summary (RSS 0.91, RSS 1.0)
RDF Site Summary (RSS 0.9 and 1.0)

RSS HISTORY

1. scriptingNews format, designed by Dave Winer at UserLand. 12/27/97.

2. RSS 0.90, designed by Netscape, for use with my.netscape.com, which also supported scriptingNews format. The only thing about it that was RDF was the header, otherwise it was plain garden-variety XML. 3/15/99.

3. scriptingNews 2.0b1, designed by Dave Winer at UserLand, enhanced to include all the features in RSS 0.90. Privately Dave Winer urged Netscape to adopt the features in this format that weren't present in RSS 0.90. 6/15/99.

4. RSS 0.91, designed by Netscape, spec written by Dan Libby, includes most features from scriptingNews 2.0b1. "We're trying to move towards a more standard format, and to this end we have included several tags from the popular format." The RDF header is gone. 7/10/99.

5. UserLand adopts RSS 0.91, deprecates scriptingNews formats. 7/28/99.

6. The RSS team at Netscape evaporates.

7. UserLand's RSS 0.91 specification. 6/4/00.

8. RSS 1.0 published as a proposal, worked on in private by a group led by Rael Dornfest at O'Reilly. Based on RDF and uses namespaces. Most elements of previous formats moved into modules. Like 0.90 it has an RDF header, but otherwise is a brand-new format, not related to any previous format. 8/14/00.

9. RSS 0.92, which is 0.91 with optional elements, designed by Dave Winer at UserLand. 12/25/00.

10. RSS 0.93 discussed but never deployed. 4/20/01.

11. MetaWeblog API merges RSS 0.92 with XML-RPC to provide a powerful blogging API. 3/14/02.

12. RSS 2.0, which is 0.92 with optional elements, designed by Dave Winer, after leaving UserLand. MetaWeblog API updated for RSS 2.0. While in development, this format was called 0.94. 9/18/02.

13. RSS 2.0 spec released through Harvard under a Creative Commons license. 7/15/03.

RSS Purpose

RSS is a format for syndicating news and the content of news-like sites
Alert people of new content
Generate up to date content without intervention
Cant' be spammed

RSS can be found - Inform blogs, news sites, wikis, WebCam, BitTorrent files

Saturday, September 30, 2006

RSS Feed

Material about RSS