Click here to Skip to main content
13,141,429 members (82,944 online)
Click here to Skip to main content
Add your own
alternative version

Stats

8.5K views
11 bookmarked
Posted 27 Oct 2016

Linked Object Oriented Programming (POOV)

, 27 Oct 2016
Rate this:
Please Sign up or sign in to vote.
POOV is a programming technique for object-oriented languages developed in MIRA Software Factory by Ing. Eduardo Mireles and experts programmers. It facilitates coding software solutions.

Introduction

Linked Object Oriented Programming (POOV)

WHAT IS POOV?

POOV is a programming technique for object-oriented languages developed in MIRA Software Factory by Ing. Eduardo Mireles and experts programmers.

  • It facilitates coding software solutions.
  • It gives greater stability and ease of maintenance codes.
  • Effectively enables compliance with deadlines and costs.
  • Reduces failures and risks.

Facilitates coding software solutions

A major problem in using object-oriented languages is that you can not get its full potential because the most widely used databases are relational, which differs to an object-oriented technique.

POOV tries to get the full potential of OOP and adds the facility to store the state of objects in relational databases, hence OOP should make a small deviation and guide the programming to the "Linking" of objects, giving POOV result.

WHAT HAPPENS TO OOP?

  • It is difficult to model in detail with UML.
  • Usually at the end does not match the model with the code.
  • The classes end up having different methods than those referred to in the model.
  • Logic, definition and functionality of methods depends greatly on the style of the programmer.
  • It is more complicated to save the state of objects in relational databases or data code is oriented to data management.
  • The same business rules may be included in different classes.

WHAT HAPPENS WITH POOV?

  • It is easy to model in detail to the lines of code with UML.
  • The code is generated and attached to the model.
  • Code structure perfectly.
  • Logic, definition and functionality of the methods is predefined and adheres to the analysis.
  • The state of the objects is fully compatible to keep in relational databases.
  • The owners of the business rules are clearly identified.
  • A standardized regardless of style programmer code is generated.

POOV proposes to focus the code to:

  • Specialize in maintaining the persistence of objects and their recovery.
  • Specialize in the types of links, rules and behaviors.
  • Maintain specialized structures to provide these features.

For this POOV it has 2 specialized interfaces:

  1. An interface that provides functionality to himself Interface (Base Interface).
  2. An interface that provides functionality to other types of objects (Linked Interface).

1.- PERSISTENCE

All objects in a system must ensure their persistence and power have a way to recover.
For this POOV proposes a generic interface for all classes that would ensure this.

The Base Interface manages the persistence of objects of a class and its methods have several features and specialties.

  • Mapping features are: ID, IsDetached, PersistentState, Accepted, Hash and Schema.
  • Methods builders: NewObject, Initialize, Clone, Reset, Refresh, Restore, and builders and Dispose own class destroyers.
  • Updaters methods: Add, Update, Delete, AcceptChanges, RejectChanges, ValidateAdd, ValidateUpdate and ValidateDelete.
  • Selection methods: Select, FreeSelect, Find and Exist.
  • Transfer methods: Get, Set, Notify, Quiet and ToString.
  • Comparators methods: Equals, Same and CompareTo.

With this interface Base is enough to secure and manage the persistence of any object of any kind, no more is necessary.

The Base Interface ensures the persistence of objects of any kind, this interface is called CCB (Control Class Base).

The purpose of a CCB is to standardize the management of persistence.
(For example, whether an object is of the Loan, Invoice or Product class persistence is administered in the same way)

Example:

New Loan:

NewLoan = Loan.NewObject();
NewLoan.Account = 5803;
NewLoan.Bank = "National";
NewLoan.Amount = 15000;
NewLoan.Add();
NewLoan.AcceptChanges();

Change Loan:

MyLoan = Loan.Find(5803);
MyLoan.Payment = 1000;
MyLoan.Update();
MyLoan.AcceptChanges();

Search Loan:

MyLoans[] = Loan.Select("National");

New Invoice:

NewInvoice = Invoice.NewObject();
NewInvoice.Number = 5803;
NewInvoice.Customer = "ABC Store";
NewInvoice.Amount = 376.25;
NewInvoice.Add();
NewInvoice.AcceptChanges();

Change Invoice:

MyInvoice = Invoice.Find(5803);
MyInvoice.Payment = 150;
MyInvoice.Update();
MyInvoice.AcceptChanges();

Search Invoice:

CustInvoices [] = Invoice.Select("ABC Store");

New Product:

NewProduct = Product.NewObject();
NewProduct.Code = "RD-671";
NewProduct.Name = "Solar Panel 260 Watts";
NewProduct.Price = 280;
NewProduct.Add();
NewProduct.AcceptChanges();

Change Product:

MyProduct = Product.Find("RD-671");
MyProduct.Price = 259.99;
MyProduct.Update();
MyProduct.AcceptChanges();

Search Product:

ListProducts[] = Product.Select();

All objects need to be born, update, search and delete. CCB provides the interface so that it can be performed in a standardized manner.

Note: What is being shown is the functionality of the CCB interface, the characteristics of the classes could be more or differnt.

2.- LINKS

In POOV there are 10 different types of links divided into 3 groups depending on their functionality:

  1. Qualifiers: Simple Qualifier (CS), Qualifier Composition (CC) and Qualifier Independent (CI).
  2. Relations: Simple Ratio (RS) Composition Ratio (RC), Historic Ratio (RH), Involution Ratio (RI).
  3. Joins: Simple Join (JS) Qualified Join Unique (JU) and Qualified Join Multiple (JM).

Be the Linked Interface manages the relationship of objects of two classes in a dependency Parent-Child and has 2 parts, the side of the Parent (P) and the side of the Child (H).

Methods Link P (Parent) are:

  • Link, Contain, Remove, Replace, LinkedClassName, ValidateLink, ValidateRemove.
  • Update, AcceptChanges, RejectChanges.

Methods Link H (Child) are:

  • NewObject, Find, Exist, Select.
  • Compute, Avg, Count, Max, Min, Sum (let you better performance calculations).

Apart from these methods, the H Link interface has an added feature that contains the parent object.

Example of a RC link type (Composition Ratio).

The RC link has 2 parts, a RCP which should give functionality to the Parent and gives the functionality RCH to the Child so that the link can operate.

The purpose of be the Linked Interface is to standardize the management of relations between classes.
For example, whether a link is between InputOutput and Kardex class or between Item and Invoice or between Invoice and Payments, the linking is administered in the same way.

Example:

New Sales:

MyKardex = Kardex.Find("RD-671");


OutSale = InputOutput.NewObject();
OutSale.Quantity= 3;
OutSale.IO = "Output";

MyKardex.Link(OutSale);
MyKardex.Update();
MyKardex.AcceptChanges();

Kardex detail:

IOs[] = MyKardex.LinkedInputOutput ();

New Invoice Item:

MyInvoice = Invoice.Find(5803);


NewItem = InvoiceItem.NewObject();
NewItem.Cant = 3;
NewItem.Product = "Solar Panel 260 Watts";

MyInvoice.Link(NewItem);
MyInvoice.Update();
MyInvoice.AcceptChanges();

Invoice detail:

InvoiceDetail[] = MyInvoice.LinkedInvoiceItem();

New Invoice payment:

MyInvoice = Invoice.Find(5803);

NewPay = Payments.NewObject();
NewPay.Amount = 75.80;
NewPay.Date = "11/06/2015";

MyInvoice.Link(NewPay);
MyInvoice.Update();
MyInvoice.AcceptChanges();

Invoice detail:

InvoicePays[] = MyInvoice.LinkedPayments();

All links require join, removed, replaced and know the parent and childs.
Linked Interface provides the interface so that it can be performed in a standardized manner.

Note: What is being shown is the functionality of the Linked Interface, the characteristics of the classes could be more or differnt.

EASES CODING

  • POOV already has many of features and methods well defined in its functionality that allow any software development, and not required anymore.
  • POOV also has a well-defined regions and sub regions specialized code structure.
  • Allows the creation Snippets of specialized and reusable code.

A Snippet is a piece of code that can be reused.
POOV promotes the use of Snippets and defines much of these so that they can generate solutions based on join pieces of code previously tested.

POOV models and specifies each link and the Snippet that will give functionality.
Thus, the Cliente (Customer) class would be encoded with a CCB Snippet which would be added 3 Property Str Snippets, a CCH Snippet, another CSP and one RSP Snippet.

For example, to encode the link between Factura (Invoice) and Partida (Items) it would:

  1. Snippet CCB is used to build the Invoice class (persistence functionality).
  2. Snippet of properties (DateTime, Int, Curr, Str, etc.) are used to add each of the features to the Invoice.
  3. Steps 1 and 2 are repeated but to encode Item class.
  4. In the Links Region of Invoice class sticks RCP Snippet that link with Item class.
  5. In the Links Region of Item class sticks RCH Snippet that link with the Invoice class.

And ready.

Example of a Snippet of property String in C # for Visual Studio.

/// <summary>
/// Obtiene o establece $Descripcion$
/// </summary>
    public string $PropertyName$
    {
        get
        {
            if (this.cObj.IsNull["$MPName$"])
            { return string.Empty; }
            else
            { return (string)this.cObj["$MPName$"]; }
        }
        set
        {
            // if (value.Equals(string.Empty)) throw new Exception("El valor de $PropertyName$ no puede ser cadena nula.");
            if (value.Length > $Length$) { throw new Exception("$PropertyName$ debe tener un máximo de $Length$ caracteres."); }
            this.cObj["$MPName$"] = value;
        }

        // ToDo Copie y cotre la siguiente línea y péguela la región "Propiedades" del método Initializes.
        lTpObj.Add(MIRA.Data.Property.NewObject(lTpObj, "$MPName$", "$FieldName$", typeof(System.String), $Length$));

        // ToDo Copie y cotre la siguiente linea y péguela en la Interfaz de la clase.
        string $PropertyName$ { get; set; }

        // ToDo Copie y cotre la siguiente linea y péguela en el método Get.
        pData.$PropertyName$ = this.$PropertyName$;

        // ToDo Copie y cotre la siguiente linea y péguela en el método Set.
        this.$PropertyName$ = pData.$PropertyName$;

    }

With POOV generate code is to joining Snippets, which have already been tested in multiple developments.
For the end attached to an application model, robust, stable and flawless.

EASE OF MAINTENANCE

As POOV has a well-defined and divided into regions and sub regions structure, any change, improvement or defect is fully localizable and estimable impact.
 

This makes it far easier maintenance and generation of new versions.

DEADLINES AND COST EFFECTIVENESS

As POOV generates code assembling pieces and model they all parts are defined that accurately quantifies:

  • Encoding time.
  • Costs.
  • Progress.
  • Changes.

REDUCE FAULTS AND RISKS

Using proven Snippet to encode the risk of failure is reduced in the code and to be the model validated by customer and developer under POOV analysis practices the risks of inaccuracies and misunderstandings are reduced thereby generating effective applications that provide solutions to the requirements.

POOV is by far a programming technique that will help develop better code.

PPT document in spanish https://1drv.ms/p/s!Aotgp_wzjDaZgawTGcq8poOY3newaA

Contact: capacita@poov.mx  

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Eduardo Mireles
Systems Engineer MIRA
Mexico Mexico
Mireles Applications Software Factory
ADAX & POOV

You may also be interested in...

Pro

Comments and Discussions

 
QuestionPOOV: is most similar to the technique used an orm of type active record Pin
AMC12-Feb-17 13:28
memberAMC12-Feb-17 13:28 
AnswerMessage Closed Pin
3-Apr-17 11:28
memberEduardo Mireles3-Apr-17 11:28 
AnswerRe: POOV: is most similar to the technique used an orm of type active record Pin
Eduardo Mireles4-Apr-17 11:15
memberEduardo Mireles4-Apr-17 11:15 
AnswerMessage Closed Pin
1-May-17 22:07
memberEduardo Mireles1-May-17 22:07 
QuestionRepetitive code, multiple responsibilities and transactions Pin
Paulo Zemek29-Oct-16 7:55
mvpPaulo Zemek29-Oct-16 7:55 
AnswerRe: Repetitive code, multiple responsibilities and transactions Pin
Eduardo Mireles30-Oct-16 11:48
memberEduardo Mireles30-Oct-16 11:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 27 Oct 2016
Article Copyright 2016 by Eduardo Mireles
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid