wtertinek / Linq2Acad

A library that aims to simplify AutoCAD .NET plugin code
MIT License
61 stars 34 forks source link

to be implemented? #1

Closed benkoshy closed 7 years ago

benkoshy commented 7 years ago

Hello Mr Wolfgang and fellow devs

what needs to be done I was wondering what Linq method require implementation (besides count lol :P )? the front page documentation was a little vague.

custom equality? also was contemplating the incorporation of custom equality to compare different elements according to specific requirements. e.g. what if there were two objects with different ids which the developer might deem to be equal: two circles with the same radius for example etc.

also i'm just having a look at Iqueryable now......why are ienumerables used instead?

rgds

Ben

wtertinek commented 7 years ago

Hello Ben,

sorry for my late answer. I think what is needed the most at the moment are real use cases for all tables and dictionaries we're working with. I think it would be beneficial if we first define use cases, that then drive the implementation.

At the moment the API supports creating, adding and querying elements for each table/dictionary. But I've never worked with - e.g. - materials in AutoCAD, so I don't know if the API should be extended by further functionality to support a better way of working with materials.

So at the moment I see more work on the conceptual side, than on the implementation. As said before, I think use cases (implemented as tests) should drive the implementation. So it would be highly appreciated if you could give input on how to work with objects of the different types (like Materials, MLeaderStyle or RegApps, etc).

Concerning the LINQ implementation I would say that there is not more to do. And if I understand you correctly, what you mean by custom equality is achievable by using the standard LINQ query operators. Like finding circles with the same radius could be done via GroupBy. I don't think that the API needs to be extended by further query operators.

IQueryable vs. IEnumerable: In the case of AutoCAD we're dealing with in memory objects, so IEnumerable is the way to go. IQueryable is used if you want your queries to be translated to other languages and the query might be executed on a remote system. Like translating your LINQ query to a SQL statement to furher execute the query on a SQL database.

Br, Wolfgang

benkoshy commented 7 years ago

Hello Mr Wolfgang

i agree with your concept that use should derive implementation. atm i don't particularly work with Materials, nor brep objects, nor deal with reactors, i'm not in the best position to comment on it atm.

i will use the library as it currently stands are perhaps it will force use case implementations. which i can then utilise.

rgds

Ben

benkoshy commented 7 years ago

Also Mr Wolfgang as a side note i found a library which, though it operates in a different context you may find it interesting because it does a similar thing you are attempting to do hide implementation details in the client code: https://github.com/DalSoft/DalSoft.RestClient --> the cost is that it uses the dynamic key word.

rgds Ben