Support for custom OclPs operations
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Support for custom OclPs operations Expand / Collapse
Author
Message
Posted 2009-04-15 14:52:32


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
Hi,

Is there any hope that it will be possible to implement custom OclPs operations?

This was added as a feature request more than a year ago but it seems it hasn't been looked after.
http://magpie.sytes.net/mantis/view.php?id=396

Regards.


My Blog: http://dnagir.blogspot.com
Post #3043
Posted 2009-04-21 01:25:32


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
I like silence it's like no news is good news

My Blog: http://dnagir.blogspot.com
Post #3106
Posted 2009-05-01 10:11:18


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
Any news?
Something like this in NH would be great to have in ECO.


My Blog: http://dnagir.blogspot.com
Post #3177
Posted 2009-05-02 10:02:28
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Today @ 20:21:00
Posts: 421, Visits: 2 536
We have been discussing and contemplating a lot of options regarding PS-operations.

There are two main aspects we have been talking about:

1. The one you ask about - hand made optimized queries expressed in the language of the PMapper (ie sql)
2. Easy access to unique unbeatable PMapper functionality like the database aggregation functions (ie sum,avg,count used with group by)

The number 2 has been has two very different possible solutions. The first solution is to implement these functions in OCLPs and that will require OCLPs to handle tuple creating in the results; one would also expect ECO to maintain returned sum and avg results using this approach and this I think is not very practical (after all the db-engine can do this on millions of rows).

So that is why I think that a solution for #2 may very well be a solution for #1.  A solution as simple as the introduction of a way to build sql from model-info.

select attributes, sql-functions from tables where joincriterias and othercriterias

The argument against this approach is that there are scenarios where the PMapper handles the types of attibutes very differently in the PStorage than what it does in ECO (boolean values being the simplest example (where x=false, should be be where x=0 etc \) ).

Anyway we welcome the discussion and we will be very happy to implement a good solution for this that stands the test of time.

(Whenever you find a "missing feature" in ECO you may consider our user-paid-for-extension strategy; you express your needs; we come up with a solution and fixed discounted price to add it to the product; your idea - our implementation reach you and all ECO users with priority. We will probably implement good ideas anyway but it will take longer time to reach you)


 

Post #3179
Posted 2009-05-02 10:09:49
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2011-07-14 17:05:00
Posts: 290, Visits: 2 617
nagir (2009-05-01)
Any news?
Something like this in NH would be great to have in ECO.


Hi Dmitriy

That's not a custom query operation it's a query string stored and retrieved by name.


====
Pete
Post #3180
Posted 2009-05-02 10:44:01
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Today @ 20:21:00
Posts: 421, Visits: 2 536
I think that the question about oclps custom op's is "the tip of the iceberg". That is why my previous answer is somewhat avoiding the question and goes sub-surface to the iceberg - how to enable model driven access to non model driven databases and at the same time enable tuning and precision of a query.

OCLPs enables access but the transformation is huge and you will loose ability to fine tune specific questions.

I think we, at some point, will need a way to have a thinner transformation between model and sql. So if I am correct in this assumption we might as well make the most of this approach and use the same solution to solve all the issues we see today.

Post #3181
Posted 2009-05-04 03:30:35


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
Hi Hans,


HansKarlsen (2009-05-02)

So that is why I think that a solution for #2 may very well be a solution for #1. A solution as simple as the introduction of a way to build sql from model-info.

select attributes, sql-functionsfrom tables where joincriterias and othercriterias


Sounds like a plan.

It might be a good start.

I don't think you should cache the result of aggregates like all other attributes.

Just thinking of possible implementation of OclPs to be used in OCL like (Product.MaxSoldPrice)...
This query should return a maximum price from all sold products.

This should execute query equal to:
select max(p.Price) as MaxSoldPrice from Product p, OrderItem oi where oi.ProductId = p.ProductId

(of course I skip a lot of details and try to abstract a bit)

The implementation of MaxSoldPrice might look like this (metacode)
public GetResult(operationInfo) {
if (operationInfo.Mapping.PsEngine is not SqlServer) {
throw new NotSupportedException ("For now this operation supports SqlServer only.".
}
var productKey = operationInfo.Mapping.GetKeyNameFor<Product>();
var productTable = operationInfo.Mapping.GetTableNameFor<Product>();
var orderInfoTable = operationInfo.Mapping.GetTableNameFor<OrderInfo>();
var orderInfoKey = operationInfo.Mapping.GetKeyNameFor<OrderInfo>();
var productPriceName = operationInfo.Mapping.GetPropertyNameFor<Product>(x=>x.Price);

var poorSqlInTermsOfPs = string.Format("select max(p.{0}) as MaxSoldPrice from {1} p, {2} oi where oi.{3} = p.{4}", productPriceName, productTable, orderInfoTable, orderInfoKey, productKey);

var query = operationInfo.CreatePsQuery(poorSqlInTermsOfPs, operationInfo.Returns<int>(), possiblySomeAdditionalSqlParameters);
var result = (int)query.Execute().AsObject;
return result;
}


Cheers.


My Blog: http://dnagir.blogspot.com
Post #3184
Posted 2009-05-04 03:38:02


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
Hi Pete,
Peter Morris (2009-05-02)

Something like this...

That's not a custom query operation it's a query string stored and retrieved by name.

The point is that we can use SQL in that query or OQL language of NHibernate which means we can create a custom query (and indeed we can retrieve that query by name).
We have OclPs in ECO but we cannot use (out of the box) custom SQL.


My Blog: http://dnagir.blogspot.com
Post #3185
Posted 2009-05-13 03:27:35


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
Knock, knock.

My Blog: http://dnagir.blogspot.com
Post #3300
Posted 2009-05-28 08:23:10


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2010-08-11 16:02:44
Posts: 338, Visits: 890
Any news on that?

My Blog: http://dnagir.blogspot.com
Post #3430
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 9:41

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,750. 7 queries. Compression Disabled.