Hola Cumpas,

En el texto del "Asunto" me encontré con esto, mientras vienen hablando de
Modularización y/o Bajo Acoplamiento.

public interface iCalcList
{

*double this[int region]{get;}*

double GetPrice(int region);

double BasePrice { get; set; }

}


Y el párrafo que le sigue dice lo siguiente, aunque no entiendo porqué el
índice, aunque lo explica no lo entiendo.

Now we have an abstract type that represents any list of calculations.
Interfaces can be implemented by
just about any C# class, allowing other developers to define their own
versions of this business rule.
Although the calculations might be defined differently for each
implementation, every one of these
classes should expose an indexer for quick reference of the calculation, a
property named BasePrice ,
where an instance ’ s original price can be set, and a method named
GetPrice that returns a calculated
value based on the region in which a customer lives. This abstract
interface is an important element of
design when it comes to building enterprise systems. They are a popular
approach to type decoupling,
which is needed when attempting to loosely couple classes that require
interaction.


Espero me puedan ayudar y, si falta que les adjunte otra parte del código o
de texto les pido tengan a bien avisarme.

Felíz Año nuevo, y muchas gracias.

Oscar R. Onorato

Responder a