Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals?

This seems an extreme question probably but I’m wondering anyhow:

Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals?

Already a lot of lower-level domain logic can, and ofen is declaratively defined with ORM-mappings for instance, handling things like:

  • domain-model schema
  • validation
  • uniqueness constraints
  • ACL/ Role-based authorization, etc

Of course higher-level domain logic exists that often involves coordinating between multiple Domain Objects.

However, it seems ultimately:

  • This high level business logic really is just a workflow that can be modeled as a state-machine (or probably more extensive as a extended petrinet)
  • in which all branching is based on conditional logic on some state (i.e: domain object attributes)
  • the outcome would be a statechange, i.e: a change to domain object attributes (simple crud operations).

If this is the case, could all domain logic be declaratively defined, given a DSL that would support the above workflow, conditional, and CRUD constructs?

If you dismiss this braindump please be insightful while doing so 🙂

Yes it can, but only in a practically useless sense.

The computation engines we usually use today are ultimately equivalent to Turing machines, which do exactly what you describe (in fact, they do less, because they have only linear-access memory to work with rather then random-access memory, but it can be proved that this makes no difference). But the state machines you would have to operate to encode even a simple application program are so disgustingly, terrifyingly huge that there is no question of actually using this model of computation in practice. It exists only as a theoretically possible mathematical entity of finite size, but on the large side of “finite”.

The point of software engineering as a discipline is to find methods to program machines for more complex behaviour with smaller, more comprehensible programs. Reading and writing individual variables is easier than switching from one state to a neighbouring state that is almost the same except for one subposition in its composite alphabet. Writing loops is easier than leaving markers on an infinite tape and shuttling back and forth until a sentinel value occurs.

That is not to say that state machines don’t have their place. When a problem domain can be naturally understood as transitions within a mentally manageable
state space, they can be the most appropriate solution to encode some operation. However, these situations are rare enough that you can basically forget about them until you actually encounter one.

I’ve come across this question five years later, and it seems more relevant than ever. Functional programming and DSL’s are hot right now, and both are examples of declarative behaviour.

Yes, I believe all business logic can be defined declaratively. Most business-specific behaviour is moving and displaying data. We already specify most data declaratively, as schemas in our databases. How the data moves can be specified via state diagrams or similar techniques, and permissions can be set by declarative authorizations of when and how data can move.

Further, perhaps all business-specific behaviour should be declarative, and only business-generic behaviour can be imperative. How many times have programmers implemented “put this address in a database, if it’s well formed”? In a business declarative world, a programmer would create a schema and business rules / state diagram, permissions, etc. Then they would find off the shelf components to run the rules. If they needed some new tool, they would create a DSL for it, then implement it in a data generic way.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa

Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals?

This seems an extreme question probably but I’m wondering anyhow:

Can all business logic be decomposed as a (declarative) state diagram on simple crud operations and conditionals?

Already a lot of lower-level domain logic can, and ofen is declaratively defined with ORM-mappings for instance, handling things like:

  • domain-model schema
  • validation
  • uniqueness constraints
  • ACL/ Role-based authorization, etc

Of course higher-level domain logic exists that often involves coordinating between multiple Domain Objects.

However, it seems ultimately:

  • This high level business logic really is just a workflow that can be modeled as a state-machine (or probably more extensive as a extended petrinet)
  • in which all branching is based on conditional logic on some state (i.e: domain object attributes)
  • the outcome would be a statechange, i.e: a change to domain object attributes (simple crud operations).

If this is the case, could all domain logic be declaratively defined, given a DSL that would support the above workflow, conditional, and CRUD constructs?

If you dismiss this braindump please be insightful while doing so 🙂

Yes it can, but only in a practically useless sense.

The computation engines we usually use today are ultimately equivalent to Turing machines, which do exactly what you describe (in fact, they do less, because they have only linear-access memory to work with rather then random-access memory, but it can be proved that this makes no difference). But the state machines you would have to operate to encode even a simple application program are so disgustingly, terrifyingly huge that there is no question of actually using this model of computation in practice. It exists only as a theoretically possible mathematical entity of finite size, but on the large side of “finite”.

The point of software engineering as a discipline is to find methods to program machines for more complex behaviour with smaller, more comprehensible programs. Reading and writing individual variables is easier than switching from one state to a neighbouring state that is almost the same except for one subposition in its composite alphabet. Writing loops is easier than leaving markers on an infinite tape and shuttling back and forth until a sentinel value occurs.

That is not to say that state machines don’t have their place. When a problem domain can be naturally understood as transitions within a mentally manageable
state space, they can be the most appropriate solution to encode some operation. However, these situations are rare enough that you can basically forget about them until you actually encounter one.

I’ve come across this question five years later, and it seems more relevant than ever. Functional programming and DSL’s are hot right now, and both are examples of declarative behaviour.

Yes, I believe all business logic can be defined declaratively. Most business-specific behaviour is moving and displaying data. We already specify most data declaratively, as schemas in our databases. How the data moves can be specified via state diagrams or similar techniques, and permissions can be set by declarative authorizations of when and how data can move.

Further, perhaps all business-specific behaviour should be declarative, and only business-generic behaviour can be imperative. How many times have programmers implemented “put this address in a database, if it’s well formed”? In a business declarative world, a programmer would create a schema and business rules / state diagram, permissions, etc. Then they would find off the shelf components to run the rules. If they needed some new tool, they would create a DSL for it, then implement it in a data generic way.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật