Re: How to do non dependence on database vendor?




"Bjorn Abelli" <bjorn_abelli@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ujCVcfYWFHA.3712@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Brett" <wrote...
>> "Bjorn Abelli" wrote...
>
>>> You could actually get away with only a single proxy if you use
>>> reflection... ;-)
>>>
>>> Through reflection you can dynamically load the ADO.NET-driver, using
>>> some kind of "ini-file" to let the proxy know where to look for it,
>>> which classnames are used for the driver, connection-strings, etc.
>>
>> However, there would be a performance hit to using Reflection. Also, I
>> like the interface approach. Everything in classes that you can
>> instantiate. Would that better than an INI file and Reflection...both of
>> which are going to be slower?
>>
>> The interface approach seems more scalable and contained.
>
> I would rather say that both approaches really are heavily based on
> interfaces, though with reflection, your implementation would be more
> flexible, as you wouldn't even need to implement a new concrete proxy for
> each new DB.
>
> For the performance hit, I would say that it possibly could be
> neglectable, as it could be "reflected" at only the startup of the
> application, but that also depends on the design of the rest of it...
>
>>> I would still look at the "data layer" from both perspectives, i.e. from
>>> the "Business Perspective" and from the "DB-perspective".
>>>
>>> What do I need to store persistent?
>>>
>>> That would make up a layer between the business logic and the data
>>> layer, focusing on storing and retrieval of the explicit data, but free
>>> from other considerations in the business logic, and free to make use of
>>> different DB-approaches. Though it would be dependant on the rest of the
>>> business logic, it frees the layer from the details of SQL, if you in
>>> the future want to make use of another DB than those supporting SQL.
>>
>> I'm still not seeing what exactly this other abstraction layer is. I
>> understand the use of a proxy (interface) and how that allows me to
>> support multiple databases using standard SQL. Say now I have another
>> database that uses non standard SQL. I add another proxy class for it.
>> Now what exactly needs to be done on this other higher level abstraction
>> layer to support the non standard SQL? Perhaps example with psuedo code?
>
> Well, you have possibly already thought of it, but included it into your
> business logic. This kind of layer is often considered a part of that
> layer as it's so dependent on the classes in the business logic.
>
> What I mean is simply an interface to the storage/retrieval of the data.
> This can be done in several ways. One way is similar to the proxy variant
> above, but foremost the use of a distinct interface for this, makes it
> easier to change it afterwards anyway.
>
> In short...
>
> interface MyBusinessStorageManager
> {
> ArrayList GetCustomers();
> ArrayList GetProducts();
> ArrayList GetOrders();
> boolean SaveOrder(Order o);
> ...
> }
>
> ...which in turn is implemented by a class that *calls* the classes with
> the SQL or others...

Right. But how does Reflection come into play here? Say for the non SQL
compliant DBs and for the purpose of not having to create a class that
inherits from the interface for each DB.

Thanks,
Brett


.



Relevant Pages

  • Re: How to do non dependence on database vendor?
    ... >> You could actually get away with only a single proxy if you use ... there would be a performance hit to using Reflection. ... > The interface approach seems more scalable and contained. ... >> That would make up a layer between the business logic and the data layer, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What do People do to avoid Tight Coupling?
    ... > have the GoF Design Patterns book, which does not mention the Separated ... > Interface Pattern as such; perhaps under a different name. ... The proxy allows you to avoid coupling, have fair performance, and expose ... >> Although the Domain layer duplicates all the properties, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to do non dependence on database vendor?
    ... >>> If I want to easily swap the database I'm using, ... The database will probably stay with Oracle, SQL Server, ... What exactly does the DB proxy layer do? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Internet Access problems in Fedora Core 4
    ... using the raw ip was to factor out DNS from the troubleshooting. ... set right or your card's interface isn't setup right. ... nameserver <proxy if proxy does dns to you or isp's dns> ... PING 64.233.179.99 56bytes of data. ...
    (comp.os.linux.misc)
  • Re: Should proxy have one interface or two
    ... Dual firewall will help you grant access to public resource/client and limit ... Vérificateur interne en sécurité de l'information ... A Proxy is a device that takes a connexion, filters it and sends it to the ... That's why you have 2 interface, to prevent the bypassing of the proxy, to ...
    (Security-Basics)