Software Architecture


Fitness Functions for Governance



Download 18,55 Mb.
bet52/169
Sana12.07.2022
Hajmi18,55 Mb.
#781543
1   ...   48   49   50   51   52   53   54   55   ...   169
Bog'liq
Software-Architecture-The-Hard-Parts

Fitness Functions for Governance


Once refactored, it’s important to govern the component domains to ensure that namespace rules are enforced and that no code exists outside the context of a component domain or subdomain. The following automated fitness function can be used to help govern component domains once they are established within the monolithic application.
Fitness function: All namespaces under should be restricted to
This automated holistic fitness function can be triggered on deployment through a CI/CD pipeline to restrict the domains contained within an application. This fitness function helps prevent additional domains from being inadvertently created by development teams and alerts the architect if any new namespaces (or directories) are created outside the approved list of domains. Example 5-10 shows an example using ArchUnit for ensuring that only the ticket, customer, and admin domains exist within an application.
Example 5-10. ArchUnit code for governing domains within an application
public

void

restrict_domains
()

{


classes
()

.
should


().
resideInAPackage
(
"..ss.ticket.."
)

.
orShould


().
resideInAPackage
(
"..ss.customer.."
)

.
orShould


().
resideInAPackage
(
"..ss.admin.."
)

.
check


(
myClasses
);

}


Sysops Squad Saga: Creating Component Domains


Thursday, November 18, 13:15
Addison and Austen consulted with Parker, the Sysops Squad product owner, and together they identified five main domains within the application: a Ticketing domain (ss.ticket) containing all ticket-related functionality, including ticket processing, customer surveys, and knowledge base (KB) functionality; a Reporting domain (ss.reporting) containing all reporting functionality; a Customer domain (ss.customer) containing customer profile, billing, and support contracts; an Admin domain (ss.admin) containing maintenance of users and Sysops Squad experts; and finally, a Shared domain (ss.shared) containing login and notification functionality used by the other domains.
Addison created a domain diagram (see Figure 5-19) showing the various domains and corresponding groups of components within each domain, and was satisfied with this grouping as no component was left out, and there was good cohesion between the components within each domain.
The exercise Addison did in diagramming and grouping the components was an important one as it validated the identified domain candidates and also demonstrated the need for collaboration with business stakeholders (such as the product owner or business application sponsor). Had the components not lined up properly or Addison was left with components that didn’t belong anywhere, more collaboration with Parker (the product owner) would have been necessary.
Satisfied that all of the components fit nicely into these domains, Addison then looked at the various component namespaces in Table 5-12 after applying the “Flatten Components Pattern” and identified the component domain refactoring that needed to take place.

Figure 5-19. The five domains identified (with darkened borders) within the Sysops Squad application

Addison started with the Ticket domain and saw that while the core ticket functionality started with the namespace ss.ticket, the survey and knowledge base components did not. Therefore, Addison wrote an architecture story to refactor the components listed in Table 5-15 to align with the ticketing domain.

Table 5-15. Sysops Squad component refactoring for the Ticket domain
Component

Domain

Current namespace

Target namespace

KB Maint

Ticket

ss.kb.maintenance

ss.ticket.kb.maintenance

KB Search

Ticket

ss.kb.search

ss.ticket.kb.search

Ticket Shared

Ticket

ss.ticket.shared

Same (no change)

Ticket Maintenance

Ticket

ss.ticket.maintenance

Same (no change)

Ticket Completion

Ticket

ss.ticket.completion

Same (no change)

Ticket Assign

Ticket

ss.ticket.assign

Same (no change)

Ticket Route

Ticket

ss.ticket.route

Same (no change)

Survey

Ticket

ss.survey

ss.ticket.survey

Next Addison considered the customer-related components, and found that the billing and survey components needed to be refactored to include them under the Customer domain, creating a Billing subdomain in the process. Addison wrote an architecture story for the refactoring of the Customer domain functionality, shown in Table 5-16.

Table 5-16. Sysops Squad component refactoring for the Customer domain
Component

Domain

Current namespace

Target namespace

Billing Payment

Customer

ss.billing.payment

ss.customer.billing.payment

Billing History

Customer

ss.billing.history

ss.customer.billing.history

Customer Profile

Customer

ss.customer.profile

Same (no change)

Support Contract

Customer

ss.supportcontract

ss.customer.supportcontract

By applying the “Identify and Size Components Pattern”, Addison found that the reporting domain was already aligned, and no further action was needed with the reporting components listed in Table 5-17.

Table 5-17. Sysops Squad Reporting components are already aligned with the Reporting domain
Component

Domain

Current namespace

Target namespace

Reporting Shared

Reporting

ss.reporting.shared

Same (no change)

Ticket Reports

Reporting

ss.reporting.tickets

Same (no change)

Expert Reports

Reporting

ss.reporting.experts

Same (no change)

Financial Reports

Reporting

ss.reporting.financial

Same (no change)

Addison saw that both the Admin and Shared domains needed alignment as well, and decided to create a single architecture story for this refactoring effort and listed these components in Table 5-18. Addison also decided to rename the ss.expert.profile namespace to ss.experts to avoid an unnecessary Expert subdomain under the Admin domain.

Table 5-18. Sysops Squad component refactoring for the Admin and Shared domains
Component

Domain

Current namespace

Target namespace

Login

Shared

ss.login

aa.shared.login

Notification

Shared

ss.notification

ss.shared.notification

Expert Profile

Admin

ss.expert.profile

ss.admin.experts

User Maintenance

Admin

ss.users

ss.admin.users

With this pattern complete, Addison realized they were now prepared to structurally break apart the monolithic application and move to the first stage of a distributed architecture by applying the Create Domain Services pattern (described in the next section).


Download 18,55 Mb.

Do'stlaringiz bilan baham:
1   ...   48   49   50   51   52   53   54   55   ...   169




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