Is it possible to migrate microsoft.practices.enterpriselibrary to oracle.dataaccess.client ?

patrick

Well-known member
Joined
Dec 5, 2021
Messages
251
Programming Experience
1-3
Hello
please answer.
the code is composed only of microsoft.practices.enterpriselibrary code.
Question-1) After deleting themicrosoft.practices.enterpriselibrary,,,,,,,,Can I replace it with oracle.dataaccess.client?
Question-2) Is the Oracle data access speed of microsoft.practices.enterpriselibrary slower than oracle.dataaccess.client?

please answer.
Thank you.
 
They are apple farms and oranges.

You are trying to replace an entire complex airplane with just a wing.
 
They are apple farms and oranges.

You are trying to replace an entire complex airplane with just a wing.

I didn't understand what you said.
Is migration possible?

Question-1) After deleting themicrosoft.practices.enterpriselibrary,,,,,,,,Can I replace it with oracle.dataaccess.client?
Question-2) Is the Oracle data access speed of microsoft.practices.enterpriselibrary slower than oracle.dataaccess.client?
 
Let put it this way: Oracle.DataAccess.Client is just a database driver. Microsoft.Practices.EnterpriseLibrary is not a database driver. It is an entire framework that supports a lot of the best practices for data access, logging, exception handling, inversion of control, validation, etc. As I recall it also supports swapping the underlying database driver that wraps for data access.

So again, my analogy of you trying to replace an entire airplane (e.g. Microsoft.Practices.EnterpriseLibrary) with just a wing (e.g. Oracle.DataAccess.Client) applies here. Or let's try another analogy: You a trying to replace an entire submarine with an electric motor.
 
Question-1) After deleting themicrosoft.practices.enterpriselibrary,,,,,,,,Can I replace it with oracle.dataaccess.client?

It depends. If the only code you were using from the Enterprise Library was just low level database access, then yes. But if you were also using the repository pattern and the unit of work patterns from the enterprise library, then no -- you would need to re-write those portions of code, or find another library that repositories and unit of work. If you were using the logging from the library, then you would need to re-write those, or find another library that does the logging. If you were using the inversion of control containers, then you would need to replace that as well.
 
Question-2) Is the Oracle data access speed of microsoft.practices.enterpriselibrary slower than oracle.dataaccess.client?

In general, the less code that needs to run, the faster the code is. Compare the amount of code that goes into the Enterprise Library as compared to the amount of code that goes into the Oracle database driver. In the end though, the only true test that can be done is by running performance testing and compare the results.
 
Let put it this way: Oracle.DataAccess.Client is just a database driver. Microsoft.Practices.EnterpriseLibrary is not a database driver. It is an entire framework that supports a lot of the best practices for data access, logging, exception handling, inversion of control, validation, etc. As I recall it also supports swapping the underlying database driver that wraps for data access.

So again, my analogy of you trying to replace an entire airplane (e.g. Microsoft.Practices.EnterpriseLibrary) with just a wing (e.g. Oracle.DataAccess.Client) applies here. Or let's try another analogy: You a trying to replace an entire submarine with an electric motor.


Question-1) your words, Is it necessary to use Microsoft.Practices.EnterpriseLibrary(Open Source) to use Oracle?
Question-2) Is it impossible to replace Microsoft.Practices.EnterpriseLibrary(Open Source) like the OracleCommand code below?
Question-3) Given the performance difference between OracleCommand and Microsoft.Practices.EnterpriseLibrary(Open Source), which is better?

C#:
private void DB_Connect(object sender, RoutedEventArgs e)

        {

            try

            {

                string strCon = "data source=onj;User ID=scott;Password=tiger";

                conn = new OracleConnection(strCon);

                conn.Open();


 

                MessageBox.Show("DB Connection OK!");


 

            }

            catch(Exception error)

            {

                MessageBox.Show(error.ToString());

            }         

        }


 

        private void Select_Emp(object sender, RoutedEventArgs e)

        {

            string sql = "select empno, ename, job from emp ";


 

            OracleCommand comm = new OracleCommand();

            if(conn == null) DB_Connect(this, null);

            comm.Connection = conn;

            comm.CommandText = sql;

                    

            OracleDataReader reader = comm.ExecuteReader(CommandBehavior.CloseConnection);

            List<EmpViewModel> emps = new List<EmpViewModel>();

            while (reader.Read())

            {

                emps.Add(new EmpViewModel() { Empno = reader.GetInt32(reader.GetOrdinal("empno")),

                                              Ename = reader.GetString(reader.GetOrdinal("ename")),

                                              Job = reader.GetString(reader.GetOrdinal("job"))

                });

            }


 

            lstView.ItemsSource = emps;

        }

    }

}
 
Last edited:
Question-1) your words, Is it necessary to use Microsoft.Practices.EnterpriseLibrary(Open Source) to use Oracle?

No.

Question-2) Is it impossible to replace Microsoft.Practices.EnterpriseLibrary(Open Source) like the OracleCommand code below?
Question-3) Given the performance difference between OracleCommand and Microsoft.Practices.EnterpriseLibrary(Open Source), which is better?

I don't know. I don't use the library. I'm anti-SQL and the time the library was being promoted around, it was always SQL facing and so I ignored it and don't use it.
 
Funny that MS.P.EL is for promoting best practice, none of which the code examples here use.

You've got your submarine up on a crane, with two holes bashed in the hull so you can put your wires directly onto the motor and use it without the need for all that complex control faffery that comes with it

You might as well throw it away :)
 
Recall that the library was written at the time XML was king, and people were still drinking the SOA Kool-Aid.
 
Back
Top Bottom