ike Low Coupling, High Cohesion is a principle to keep in mind during  translation - ike Low Coupling, High Cohesion is a principle to keep in mind during  Indonesian how to say

ike Low Coupling, High Cohesion is

ike Low Coupling, High Cohesion is a principle to keep in mind during all
design decisions; it is an underlying goal to continually consider. It is an evaluative principle that a designer applies while evaluating all design decisions.
Grady Booch describes high functional cohesion as existing when the elements
of a component (such as a class) "all work together to provide some well-bounded
behavior" [Booch94].
Here are some scenarios that illustrate varying degrees of functional cohesion:
1. Very low cohesionóA class is solely responsible for many things in very dif
ferent functional areas.
o Assume a class exists called RDB-RPC-Interface which is completely responsible for interacting with relational databases and
for handling remote procedure calls. These are two vastly different
functional areas, and each requires lots of supporting code. The
responsibilities should be split into a family of classes related to
RDB access and a family related to RFC support.
2. Low cohesionóA class has sole responsibility for a complex task in one func
tional area.
o Assume a class exists called RDBInterface which is completely
responsible for interacting with relational databases. The methods
of the class are all related, but there are lots of them, and a tremendous amount of supporting code; there may be hundreds or
thousands of methods. The class should split into a family of lightweight classes sharing the work to provide RDB access.
234
Figure 16.12 Sale creates Payment
In practice, the level of cohesion alone canít be considered in isolation from other responsibilities and other
principles such as Expert and Low Coupling.
16 - GRASP: DESIGNING OBJECTS WITH RESPONSIBILITIES
: Register : Sale
makePayment()
: Payment
create()
makePayment()
HIGH COHESION
3. High cohesionóA class has moderate responsibilities in one functional area
and collaborates with other classes to fulfill tasks.
o Assume a class exists called RDBInterface which is only partially
responsible for interacting with relational databases. It interacts
with a dozen other classes related to RDB access in order to
retrieve and save objects.
4. Moderate cohesionóA class has lightweight and sole responsibilities in a
few different areas that are logically related to the class concept, but not to
each other.
o Assume a class exists called Company which is completely responsible for (a) knowing its employees and (b) knowing its financial
information. These two areas are not strongly related to each
other, although both are logically related to the concept of a company. In addition, the total number of public methods is small, as is
the amount of supporting code.
As a rule of thumb, a class with high cohesion has a relatively small number of
methods, with highly related functionality, and does not do too much work. It
collaborates with other objects to share the effort if the task is large.
A class with high cohesion is advantageous because it is relatively easy to maintain, understand, and reuse. The high degree of related functionality, combined
with a small number of operations, also simplifies maintenance and enhancements. The fine grain of highly related functionality also supports increased
reuse potential.
The High Cohesion patternólike many things in object technologyóhas a
real-world analogy. It is a common observation that if a person takes on too many
unrelated responsibilitiesóespecially ones that should properly be delegated to
othersóthen the person is not effective. This is observed in some managers who
have not learned how to delegate. These people suffer from low cohesion; they
are ready to become "unglued."
Another Classic Principle: Modular Design
Coupling and cohesion are old principles in software design; designing with
objects does not imply ignoring well-established fundamentals. Another of
theseówhich is strongly related to coupling and cohesionóis to promote modular design. To quote:
Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules
[Booch94].
We promote a modular design by creating methods and classes with high cohesion. At the basic object level, modularity is achieved by designing each method
with a clear, single purpose, and grouping a related set of concerns into a class.
235
16 - GRASP: DESIGNING OBJECTS WITH RESPONSIBILITIES
Cohesion and Coupling; Yin and Yang
Bad cohesion usually begets bad coupling, and vice versa. 1 call
cohesion and coupling the yin and yang of software engineering
because of their interdependent influence. For example, consider a GUI widget
class that represents and paints a widget, saves data to a database, and invokes
remote object services. Not only is it profoundly incohesive, but it is coupled to
many (and disparate) elements.
Contraindications There are a few cases in which accepting lower cohesion is justified.
One case is the grouping of responsibilities or code into one class or component to
simplify maintenance by one personóalthough be warned that such grouping may
also make maintenance worse. But for example, suppose an application contains
embedded SQL statements that by other good design principles should be
distributed across ten classes, such as ten "database mapper" classes. Now, it is
common that only one or two SQL experts know how to best define and maintain
this SQL, even if there are dozens of object-oriented (OO) programmers on the
project; few OO programmers may have strong SQL skills. Suppose the SQL
expert is not even a comfortable OO programmer. The software architect may
decide to group all the SQL statements into one class, RDBOperations, so that it is
easy for the SQL expert to work on the SQL in one location.
Another case for components with lower cohesion is with distributed server
objects. Because of overhead and performance implications associated with
remote objects and remote communication, it is sometimes desirable to create
fewer and larger, less cohesive server objects that provide an interface for many
operations. This is also related to the pattern called Coarse-Grained Remote
Interface, in which the remote operations are made more coarse-grained in
order to do or request more work in remote operation call, because of the performance penalty of remote calls over a network. As a simple example, instead of a
remote object with three fine-grained operations setName, setSalary, and
setHi-reDate, there is one remote operation setData which receives a set of data.
This results in less remote calls, and better performance.
Benefits ï Clarity and ease of comprehension of the design is increased.
ï Maintenance and enhancements are simplified.
ï Low coupling is often supported.
ï The fine grain of highly related functionality supports increased reuse
because a cohesive class can be used for a very specific purpose.
0/5000
From: -
To: -
Results (Indonesian) 1: [Copy]
Copied!
Ike Coupling rendah, tinggi kohesi adalah prinsip untuk diingat selama semua Desain keputusan; ini adalah tujuan mendasar untuk mempertimbangkan terus-menerus. Ini adalah prinsip Evaluatif yang perancang berlaku ketika mengevaluasi semua keputusan desain.Grady Booch menggambarkan tinggi fungsional kohesi sebagai yang ada ketika elemen komponen (seperti kelas) "semua bekerja sama untuk memberikan beberapa baik Berikat perilaku"[Booch94].Berikut adalah beberapa skenario yang menggambarkan berbagai derajat fungsional kohesi:1. sangat rendah cohesionóA kelas bertanggung jawab untuk banyak hal dalam sangat sulit ferent bidang fungsional.o asumsikan ada kelas yang disebut RDB-RPC-Interface yang benar-benar bertanggung jawab untuk berinteraksi dengan database relasional dan untuk menangani panggilan prosedur jauh. Ini adalah dua sangat berbeda bidang fungsional, dan masing-masing memerlukan banyak mendukung kode. The tanggung jawab harus dibagi ke dalam sebuah keluarga kelas yang berkaitan dengan RDB akses dan keluarga yang berhubungan dengan RFC dukungan.2. rendah cohesionóA kelas memiliki tanggung jawab untuk tugas kompleks dalam satu func ili daerah.o asumsikan ada kelas yang disebut RDBInterface yang benar-benar bertanggung jawab untuk berinteraksi dengan database relasional. Metode dari kelas semua berhubungan, tetapi ada banyak dari mereka, dan sejumlah besar mendukung kode; mungkin ada ratusan atau ribuan metode. Kelas harus dibagi menjadi keluarga kelas ringan berbagi pekerjaan untuk menyediakan akses RDB.234Figure 16.12 Sale creates Payment In practice, the level of cohesion alone canít be considered in isolation from other responsibilities and other principles such as Expert and Low Coupling. 16 - GRASP: DESIGNING OBJECTS WITH RESPONSIBILITIES: Register : SalemakePayment(): Paymentcreate()makePayment()HIGH COHESION3. High cohesionóA class has moderate responsibilities in one functional area and collaborates with other classes to fulfill tasks.o Assume a class exists called RDBInterface which is only partially responsible for interacting with relational databases. It interacts with a dozen other classes related to RDB access in order to retrieve and save objects.4. Moderate cohesionóA class has lightweight and sole responsibilities in a few different areas that are logically related to the class concept, but not to each other.o Assume a class exists called Company which is completely responsible for (a) knowing its employees and (b) knowing its financial information. These two areas are not strongly related to each other, although both are logically related to the concept of a company. In addition, the total number of public methods is small, as is the amount of supporting code.As a rule of thumb, a class with high cohesion has a relatively small number of methods, with highly related functionality, and does not do too much work. It collaborates with other objects to share the effort if the task is large.A class with high cohesion is advantageous because it is relatively easy to maintain, understand, and reuse. The high degree of related functionality, combined with a small number of operations, also simplifies maintenance and enhancements. The fine grain of highly related functionality also supports increased reuse potential.The High Cohesion patternólike many things in object technologyóhas a real-world analogy. It is a common observation that if a person takes on too many unrelated responsibilitiesóespecially ones that should properly be delegated to othersóthen the person is not effective. This is observed in some managers who have not learned how to delegate. These people suffer from low cohesion; they are ready to become "unglued."Another Classic Principle: Modular DesignCoupling and cohesion are old principles in software design; designing with objects does not imply ignoring well-established fundamentals. Another of theseówhich is strongly related to coupling and cohesionóis to promote modular design. To quote:Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules [Booch94].We promote a modular design by creating methods and classes with high cohesion. At the basic object level, modularity is achieved by designing each method with a clear, single purpose, and grouping a related set of concerns into a class.235 16 - GRASP: DESIGNING OBJECTS WITH RESPONSIBILITIESCohesion and Coupling; Yin and YangBad cohesion usually begets bad coupling, and vice versa. 1 call cohesion and coupling the yin and yang of software engineering because of their interdependent influence. For example, consider a GUI widget class that represents and paints a widget, saves data to a database, and invokes remote object services. Not only is it profoundly incohesive, but it is coupled to many (and disparate) elements.Contraindications There are a few cases in which accepting lower cohesion is justified.One case is the grouping of responsibilities or code into one class or component to simplify maintenance by one personóalthough be warned that such grouping may also make maintenance worse. But for example, suppose an application contains embedded SQL statements that by other good design principles should be distributed across ten classes, such as ten "database mapper" classes. Now, it is common that only one or two SQL experts know how to best define and maintain this SQL, even if there are dozens of object-oriented (OO) programmers on the project; few OO programmers may have strong SQL skills. Suppose the SQL expert is not even a comfortable OO programmer. The software architect may decide to group all the SQL statements into one class, RDBOperations, so that it is easy for the SQL expert to work on the SQL in one location.Another case for components with lower cohesion is with distributed server objects. Because of overhead and performance implications associated with remote objects and remote communication, it is sometimes desirable to create fewer and larger, less cohesive server objects that provide an interface for many operations. This is also related to the pattern called Coarse-Grained Remote Interface, in which the remote operations are made more coarse-grained in order to do or request more work in remote operation call, because of the performance penalty of remote calls over a network. As a simple example, instead of a remote object with three fine-grained operations setName, setSalary, and setHi-reDate, there is one remote operation setData which receives a set of data. This results in less remote calls, and better performance.Benefits ï Clarity and ease of comprehension of the design is increased.ï Maintenance and enhancements are simplified. ï Low coupling is often supported. ï The fine grain of highly related functionality supports increased reuse because a cohesive class can be used for a very specific purpose.
Being translated, please wait..
Results (Indonesian) 2:[Copy]
Copied!
ike Rendah Coupling, Kohesi tinggi adalah prinsip yang perlu diingat selama semua
keputusan desain; itu adalah tujuan yang mendasari untuk terus dipertimbangkan. Ini adalah prinsip evaluatif yang seorang desainer berlaku saat mengevaluasi semua keputusan desain.
Grady Booch menjelaskan kohesi fungsional tinggi yang ada ketika unsur-unsur
dari komponen (seperti kelas) "semua bekerja sama untuk menyediakan beberapa baik dibatasi
perilaku" [Booch94] .
Berikut adalah beberapa skenario yang menggambarkan berbagai tingkat kohesi fungsional:
1. Kelas cohesionóA sangat rendah bertanggung jawab untuk banyak hal di sangat dif
bidang fungsional yang berbeda-.
O Asumsikan kelas ada yang disebut RDB-RPC-Interface yang benar-benar bertanggung jawab untuk berinteraksi dengan database relasional dan
untuk menangani panggilan prosedur remote. Ini adalah dua sangat berbeda
area fungsional, dan masing-masing membutuhkan banyak kode pendukung. The
tanggung jawab harus dipecah menjadi keluarga kelas terkait dengan
RDB akses dan keluarga yang terkait dengan dukungan RFC.
2. Kelas cohesionóA rendah memiliki tanggung jawab untuk tugas yang kompleks dalam satu func
daerah nasional.
O Asumsikan kelas eksis disebut RDBInterface yang benar-benar
bertanggung jawab untuk berinteraksi dengan database relasional. Metode
kelas semua terkait, tapi ada banyak dari mereka, dan sejumlah besar kode mendukung; mungkin ada ratusan atau
ribuan metode. Kelas harus dibagi menjadi keluarga kelas ringan berbagi pekerjaan untuk menyediakan akses RDB.
234
Gambar 16.12 Sale menciptakan Pembayaran
Dalam prakteknya, tingkat kohesi saja Canit dipertimbangkan dalam isolasi dari tanggung jawab lain dan lain
prinsip-prinsip seperti Ahli dan Low Coupling.
16 - GRASP: MERANCANG BENDA DENGAN TANGGUNG
JAWAB: Registrasi: Sale
makePayment
(): Pembayaran
buat ()
makePayment ()
TINGGI KERUKUNAN
3. Kelas cohesionóA tinggi memiliki tanggung jawab moderat dalam satu area fungsional
dan bekerja sama dengan kelas-kelas lain untuk memenuhi tugas.
O Asumsikan kelas eksis disebut RDBInterface yang hanya sebagian
bertanggung jawab untuk berinteraksi dengan database relasional. Berinteraksi
dengan selusin kelas lain yang berkaitan dengan akses RDB untuk
mengambil dan menyimpan benda-benda.
4. Kelas cohesionóA moderat memiliki tanggung jawab yang ringan dan satu-satunya di
daerah yang berbeda yang secara logis berhubungan dengan konsep kelas, tetapi tidak untuk
satu sama lain.
O Asumsikan kelas ada yang disebut Perusahaan yang benar-benar bertanggung jawab untuk (a) mengetahui karyawan dan (b) mengetahui keuangan
informasi. Kedua daerah tidak sangat terkait satu sama
lain, meskipun keduanya secara logis terkait dengan konsep perusahaan. Selain itu, jumlah total metode umum kecil, seperti
jumlah kode mendukung.
Sebagai aturan praktis, kelas dengan kohesi tinggi memiliki jumlah yang relatif kecil dari
metode, dengan fungsi yang sangat terkait, dan tidak melakukan terlalu banyak kerja. Ini
bekerja sama dengan benda-benda lain untuk berbagi usaha jika tugas besar.
Sebuah kelas dengan kohesi tinggi adalah menguntungkan karena relatif mudah untuk mempertahankan, memahami, dan menggunakan kembali. Tingkat tinggi fungsi terkait, dikombinasikan
dengan sejumlah kecil operasi, juga menyederhanakan pemeliharaan dan perangkat tambahan. The butir halus dari fungsi yang sangat terkait juga mendukung peningkatan
potensi reuse.
The High Kohesi patternólike banyak hal dalam objek technologyóhas sebuah
analogi dunia nyata. Ini adalah pengamatan umum bahwa jika seseorang mengambil terlalu banyak
yang responsibilitiesóespecially terkait yang harus benar didelegasikan kepada
othersóthen orang tersebut tidak efektif. Hal ini diamati pada beberapa manajer yang
belum belajar bagaimana untuk mendelegasikan. Orang-orang ini menderita kohesi rendah; mereka
siap menjadi "unglued."
lain Klasik Prinsip: Desain Modular
Coupling dan kohesi adalah prinsip-prinsip lama dalam desain perangkat lunak; merancang dengan
benda-benda tidak berarti mengabaikan fundamental mapan. Lain
theseówhich sangat terkait dengan kopling dan cohesionóis untuk mempromosikan desain modular. Untuk kutipan:
Modularity adalah milik dari sistem yang telah didekomposisi menjadi serangkaian kohesif dan longgar ditambah modul
[Booch94].
Kami mempromosikan desain modular dengan menciptakan metode dan kelas dengan kohesi tinggi. Pada tingkat dasar objek, modularitas dicapai dengan merancang setiap metode
dengan jelas, tujuan tunggal, dan pengelompokan satu set terkait kekhawatiran ke dalam kelas.
235
16 - GRASP: MERANCANG BENDA DENGAN TANGGUNG JAWAB
Kohesi dan Coupling; Yin dan Yang
Bad kohesi biasanya melahirkan kopling buruk, dan sebaliknya. 1 panggilan
kohesi dan kopling yin dan yang dari rekayasa perangkat lunak
karena pengaruh saling tergantung mereka. Sebagai contoh, mempertimbangkan GUI widget
kelas yang mewakili dan cat widget, menyimpan data ke database, dan memanggil
layanan remote object. Tidak hanya itu amat incohesive, tetapi digabungkan ke
banyak (dan berbeda) elemen.
Kontraindikasi Ada beberapa kasus di mana menerima kohesi lebih rendah dibenarkan.
Salah satu kasus adalah pengelompokan tanggung jawab atau kode dalam satu kelas atau komponen untuk
menyederhanakan pemeliharaan oleh salah satu personóalthough diperingatkan bahwa pengelompokan tersebut dapat
juga membuat perawatan lebih buruk. Tapi untuk Misalnya, aplikasi berisi
pernyataan SQL tertanam bahwa dengan prinsip-prinsip desain yang baik lainnya harus
didistribusikan di sepuluh kelas, seperti sepuluh "Database mapper" kelas. Sekarang, itu adalah
umum bahwa hanya satu atau dua ahli SQL tahu bagaimana mendefinisikan terbaik dan memelihara
SQL ini, bahkan jika ada puluhan berorientasi obyek (OO) programmer pada
proyek; Beberapa programmer OO mungkin memiliki keterampilan SQL yang kuat. Misalkan SQL
ahli bahkan bukan programmer OO nyaman. Arsitek perangkat lunak mungkin
memutuskan untuk kelompok semua pernyataan SQL ke dalam satu kelas, RDBOperations, sehingga
mudah bagi ahli SQL untuk bekerja pada SQL dalam satu lokasi.
Lain halnya untuk komponen dengan kohesi yang lebih rendah dengan server yang didistribusikan
benda. Karena implikasi overhead dan kinerja yang terkait dengan
objek remote dan komunikasi jarak jauh, kadang-kadang diinginkan untuk membuat
lebih sedikit dan lebih besar, objek server kurang kohesif yang menyediakan antarmuka untuk berbagai
operasi. Hal ini juga terkait dengan pola yang disebut kasar jauh
Interface, di mana operasi jarak jauh yang dibuat lebih kasar-grained di
untuk melakukan atau meminta lebih banyak pekerjaan dalam panggilan operasi remote, karena hukuman kinerja panggilan jarak jauh melalui jaringan. Sebagai contoh sederhana, bukannya
objek remote dengan tiga operasi halus setName, setSalary, dan
Sethi-reDate, ada satu setData operasi remote yang menerima satu set data.
Hal ini menyebabkan panggilan kurang terpencil, dan kinerja yang lebih baik.
Manfaat ï Kejelasan dan kemudahan pemahaman desain meningkat.
ï Pemeliharaan dan perangkat tambahan yang disederhanakan.
ï kopling rendah sering didukung.
I butir halus dari fungsi yang sangat terkait mendukung peningkatan penggunaan kembali
karena kelas kohesif dapat digunakan untuk tujuan yang sangat spesifik.
Being translated, please wait..
 
Other languages
The translation tool support: Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bosnian, Bulgarian, Catalan, Cebuano, Chichewa, Chinese, Chinese Traditional, Corsican, Croatian, Czech, Danish, Detect language, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Frisian, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Korean, Kurdish (Kurmanji), Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Myanmar (Burmese), Nepali, Norwegian, Odia (Oriya), Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scots Gaelic, Serbian, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Tatar, Telugu, Thai, Turkish, Turkmen, Ukrainian, Urdu, Uyghur, Uzbek, Vietnamese, Welsh, Xhosa, Yiddish, Yoruba, Zulu, Language translation.

Copyright ©2025 I Love Translation. All reserved.

E-mail: