Clean Architecture



Download 6,37 Mb.
Pdf ko'rish
bet38/259
Sana26.02.2022
Hajmi6,37 Mb.
#465587
1   ...   34   35   36   37   38   39   40   41   ...   259
Bog'liq
Clean Architecture A Craftsman’s Guide to Software Structure and Design by Robert C. Martin (z-lib.org)

C o n c lu s i o n
What is OO? There are many opinions and many answers to this question. 
To the software architect, however, the answer is clear: OO is the ability, 
through the use of polymorphism, to gain absolute control over every source 
code dependency in the system. It allows the architect to create a plugin 
architecture, in which modules that contain high-level policies are 
independent of modules that contain low-level details. The low-level details 
are relegated to plugin modules that can be deployed and developed 
independently from the modules that contain high-level policies.
www.EBooksWorld.ir


This page intentionally left blank 
www.EBooksWorld.ir


49
6
F u n c tio n a l 
Prog r a m m i ng
www.EBooksWorld.ir


Chapter 6 Functional Programming
50
In many ways, the concepts of functional programming predate programming 
itself. This paradigm is strongly based on the 
l
-calculus invented by Alonzo 
Church in the 1930s.
S qua r e s o f I n t e g e r s
To explain what functional programming is, it’s best to examine some 
examples. Let’s investigate a simple problem: printing the squares of the first 
25 integers.
In a language like Java, we might write the following: 
public class Squint {
public static void main(String args[]) {
for (int i=0; i<25; i++)
System.out.println(i*i);
}
}
In a language like Clojure, which is a derivative of Lisp, and is functional, we 
might implement this same program as follows:
(println (take 25 (map (fn [x] (* x x)) (range))))
If you don’t know Lisp, then this might look a little strange. So let me 
reformat it a bit and add some comments.
(println ;___________________ Print
(take 25 ;_________________ the first 25
(map (fn [x] (* x x)) ;__ squares
(range)))) ;___________ of Integers
It should be clear that 
println

take

map
, and 
range
are all functions. In 
Lisp, you call a function by putting it in parentheses. For example, 
(range)
calls the range function. 
www.EBooksWorld.ir



Download 6,37 Mb.

Do'stlaringiz bilan baham:
1   ...   34   35   36   37   38   39   40   41   ...   259




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish