unique_alex020
unique_alex020

Reputation: 64

How to difference a requirement/functionality from Business Logic?

I am documenting a project and I have found myself wondering if this is a requirement, a functionality or business logic, after all it is a chat system and if this is not the business logic I would not be able to say what it is. Here is what i think is bl:

We'll describe starting from the fact that a user 'A' is connected to a chat with user B and 'A' sends a message. Cases to consider:

Case #1

User B is also connected. Any exchanged message should be displayed in real-time for both.
Afterwards, it should be saved in the database so that the chat has a history (marked as read).
The list of chats mentioned above should be reordered.

Case #2

User B is within the app but not connected to the chat with user A.
The message should be saved in the database (marked as unread).
User B should be notified and shown that there are new unread messages in the chat (notification or display within the app).
The aforementioned list of chats should be updated for reordering.

Case #3

User B is completely disconnected.
The message will be saved in the database (as unread).
A push notification will be sent to user B.

Upvotes: 0

Views: 191

Answers (3)

Julio Di Egidio
Julio Di Egidio

Reputation: 1110

if this is a requirement, a functionality or business logic

Those are not the technical distinctions: requirements in software engineering come in two (and only two) categories, explicit vs implicit (see below for the meaning, short of a good engineering book), and what you ask about belongs specifically to the former side of requirements.

Namely, yours are examples of usage scenarios (whether or not part of e.g. a Use Case analysis specifically, or User Stories, etc.), and they indeed belong to

  • the conceptual, aka functional, aka business, aka explicit side of requirements; as opposed to

  • the technical, aka non-functional, aka implicit side of requirements.

Upvotes: 0

Adrian K
Adrian K

Reputation: 10215

  • Requirements define things the solution needs to do - these should ideally be testable.
  • Functionality refers to something, usually visible to the end user, that the solution does or provides.
  • Business Logic is a convention in systems design/architecture that refers to technology agnostic rules/logic. It it's most pure form it would cover only "business" concepts that were directly related to the functionality the system provides, but it in some systems it can also be a place where general orchestration of processing calls occurs - or a mix of both. What it means can vary a bit depending on the architecture.
  • Any exchanged message should be displayed in real-time for both.
  • Afterwards, it should be saved in the database so that the chat has a history (marked as read).
  • The list of chats mentioned above should be reordered.
  • The message should be saved in the database (marked as unread).
  • User B should be notified and shown that there are new unread messages in the chat (notification or display within the app).
  • The aforementioned list of chats should be updated for reordering.
  • The message will be saved in the database (as unread).
  • A push notification will be sent to user B.

These (above) are all requirements, because they define things the solution needs to do - whether it be a behavior or outcome.

Ideally requirements should be testable - in that regard some of the requirements could be improved.

Requirements come in different types. A lot of these are System Requirements or Technical Requirements - meaning they are what I might expect a technical analysist to produce for a developer.

Other types include Non-Functional Requirements (NFR) which deal with system qualities such as performance and availability, and Business Requirements which describe outcomes that "the business" (the client) wants - these should or tend to be technology agnostic.

Any exchanged message should be displayed in real-time for both.

That's an interesting one - context and intent is so important: this one could be interpreted as functionality, a business requirement or an NFR:

  • It could be seen as a business requirement because it's describing user-visible behaviors which are obviously important to the client; if we don't implement this the client will not be happy.
  • It's also true that such a business requirement should lead to some related NFR's. As written, this indicates to me as an architect that performance is a key consideration here, but its not testable.
  • It could be described as a functionality if we were talking about the system through a marketing lens: "Look, our system has real-time messaging".

As a practical note, its not uncommon for things like you have listed to be subject to debate in terms of which category they fall into, so whilst I would definitely try to categorize things correctly I'd also try and avoid spending too much time on things that fall into that grey zone.

Terms like "real-time" can become problematic when you think about human vs computer context - what appears as real-time to us is not instantaneous to a computer.

Upvotes: -2

Rob Conklin
Rob Conklin

Reputation: 9446

Requirement: I, as a user want to be able to accomplish X

Functionality: The system provides functionality Y (in order to satisfy X)

Business Logic: The software implements logic Z (in order to implement Y)

Requirements are what the user's goal is, what need do they have to be fulfilled, it is the WHY. Functionality is WHAT the system does. And business logic is HOW the system does it.

In your example, the Requirement is that user A can deliver a message to user B. The requirement doesn't talk about the how, or databases, or interfaces, just the goal of User A to deliver a message to User B.

The functionality includes:

  • Real-time delivery of messages when both parties are online.
  • Offline delivery of messages when user B is not online at the same time as user A
  • etc

The business logic includes:

  • User B is within the app but not connected to the chat with user A. The message should be saved in the database (marked as unread)
  • The list of chats should be updated for reordering.
  • etc

Upvotes: 1

Related Questions