Skip to content

OneLine Framework

Anthony G. Rivera Cosme edited this page Aug 2, 2023 · 35 revisions

What we will be talking about

  • What is OneLine framework?
  • What is OneLine principles?
  • What is OneLine architecture?
  • What is OneLine goal and how this framework differs from the others frameworks?
  • Which are OneLine benefits and how this helps development?
  • Which languages or technologies are supported?
  • What is OneLine road map?
  • How can I contribute to this project?
  • In summary

What is OneLine framework?

OneLine is an abstraction standardized redefined framework.

What are OneLine principles?

OneLine follows the same principles that we already know:

  • Abstraction
  • Inheritance
  • Composition
  • Divide and Conquer
  • Single Responsibility
  • Separation of Concerns
  • KISS (Keep It Simple, Stupid)
  • DRY (Don't Repeat Yourself)
  • YAGNI (You Aren't Gonna Need It)
  • DNA (Do Not Assume)

Seems funny isn't?

But yes this principles even if we are talking about programming world this principles can be applied to our daily lives.

We don't need to be religious or even believe in god to be a good person but we need to have principles.

Principles are what define us as a person.

On top of our principles we have standards.

On top of our standards we give definition/meaning to our standards and principles.

Never forget about this 3 things:

  1. Principles
  2. Standards
  3. Definitions

This are the keywords to design and develop successful software.

I said once:

But why we are all still writing the same code over and over?

This is because we are not applying any principles, standards and definitions at all even if we are or trying to follow one or many of them.

Thats why oneline exists.

Oneline created his owns principles, standards and definitions based on the ancestor principles "the programming principles".

Oneline has his own principles, standards and definitions on top of the programming principles which all together I call it "logical scheme".

The logical scheme is the scheme which at its genesis was just an analyzer of database desing with focus in the key of "patterns of behavior".

If you take a deep closer look to the software patterns of behavior we just need to solve 1 problem at the time, make it editable to provide any possible variation of it.

End of the story.

Now believe me, if you are developing without any principles/standards/definitions you are doing it wrong.

It took around 10 years to realize than I were developing the wrong way since I started.

There are even developers that never realize this in their entire career.

What is OneLine architecture?

Well this is a hard question to maintain this answer over time.

Technology changes so drastically over the time that seems hard to be updated to what is new on development world.

OneLine uses a Redefined way to work and develop on top on web API (Application Programming Interface) and SPA (Single Page Application) architectures applying:

  1. Principles
  2. Standards
  3. Definitions

Client Side

Client side seems to be the most hard thing on the development on every project.

But OneLine on top of Blazor which is a SPA framework seems to tackle this in a very nice, simple and easy way using componentization (component-based development) principles.

OneLine combined with OneLine Tool manages every entity in different pre implemented components using base classes implementation to manage forms and views.

This base classes gives a high level of abstraction and resolve the basic patterns of a form or view.

This base classes principles can be reused on other types of applications (CLI (command line interface), tools, desktop, tablet, mobile apps) and even re-implemented or ported to other languages when trying to do something similar to OneLine Tool.

Server side

  • Data is exchanged in JSON (Input and Output) (XML as well but is turned off by default) and/or binary (blobs) formats.
  • Database transaction excluding search operation are auto audited.
  • Exception that may occur are recorded.
  • Search of record list is always paged.
  • Requests are fully recorded for auditing purpose.
  • Responses from the server have a base API response structure and can be also record (recording search response are turned off by default).
  • Data list model is capable to download/upload on *.csv format.
    • Not sure of this but as far as I know .csv files format are the lightest weight format.
  • Redefined Repository/Service Design Pattern as Repository Service

Take note that a *.csv format file are lightweight and can be parsed and read by Excel or any like Excel software.

Base/Common/Shared

OneLine with the help of Blazor we can share our models, services, validations on client side and server side as well.

This is one of the biggest plus of .net and on any framework developed on top of blazor, we can share everything.

This should be the heart of our application apart from the web api and the database transactions.

How OneLine framework differs from the others frameworks?

OneLine tries to abstract development efforts breaking common development patterns in a redefined way.

But how?

Just by starting off from general and specific applications behaviors like OneLine Tool does for you.

How this can be achieve?

  • Defining generic interfaces/headers.
  • Defining and using actions before and after any task/action.
    • Before Action
    • Current Action
    • After Action
  • Applying the appropriate implementations.

Take note that mostly every action as a before action and after action.

What are these actions?

These actions are just methods were we decide what sub actions and/or sub tasks perform before or after any task.

These actions and tasks should be chained between them.

Take note that OneLine may use open source libraries to achieve resolving tasks more easier and faster.

Let's put a simple example to confirm my theory about that mostly every action as a before action and after action

Client Side Example:

When saving a record for example:

  • As Before Action we could:
    • Validate the data.
    • Prompt to confirm the action.
    • Prompt to request more information.
  • As Current Action we simply save the record by calling the api.
    • We save the response in memory at this step.
  • As After Action we could:
    • Validate the response
    • Take some action depending on the response result:
      • If we received and OK we could.
        • Navigate to somewhere else like a workflow.
        • Show a success dialog and navigate after dismissing it.
        • Show more info that needs to be provided.
      • If we received a 401 response code we may navigate out of the current page and go to the login.
      • If we received a 500 response code then display a friendly message to the user that the current service as an error or it's unavailable.

Server Side Example:

When saving a record for example:

  • As Before Action we could:
    • Validate security rules.
    • Validate the data rules.
    • Check for any other prerequisites.
  • As Current Action we simply save the record in our database.
    • We save the record in memory.
  • As After Action we could:
    • Execute any type of transaction to other entities.
    • Call or consume any other third party service/api.
    • Send a notification message via push notification, email or text message.
    • Update the current record state via SignalR push mechanism in real time.
    • Return an empty or the current entity as a response to the client.

Which are OneLine benefits and how this helps development?

  • Extreme fast, optimized and high level development.
  • Reduces development bugs or errors margin to almost 0%.
  • Increase developers productivity starting from 500% to 1200%.
  • The development from scratch application real estimated time will be cut from 62% to 84%.
  • Less coding to resolve general or specific software patterns.
  • Less code is easier to maintain.

Take note that this approximate percents have been calculated based on my development experience based on hard data management applications nature and also comparing real scratch application development vs going on top of OneLine and OneLine Tool.

Which languages or technologies are supported?

OneLine was originated developed on 2013 on top of PHP but I left using PHP years ago for various reasons.

OneLine is on top of c# using .net.

What is OneLine road map?

Please follow this link for details.

How can I contribute to this project?

Please follow this link for details.

In summary

  • OneLine have principles, standards and definitions.
  • OneLine is a framework that tries to resolve real problems in a standardized redefined way.
  • OneLine will be adding new standards and definitions over time but maintaining the same principles.
  • OneLine should be used on brand new application development.
    • On migrating existing application we will provide a guideline for this.
  • What is from or should stay on the server side stays in the server.
  • What is from or should stay on the client side stays in the client.
  • OneLine is recyclable, what should be common or shared on both sides is already shared on both sides server and client.

Clone this wiki locally