You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The Python C API has the PyObject *PyType_Type object, which is equivalent to type in the interpreter. If I want to define a metaclass in C++, how can I set type as one of its bases in Boost.Python? Also, what other things should I take into consideration when defining a Python metaclass in C++?</p>
26
+
27
+
<p>It'd be ideal if there was a Boost.Python solution to this. If not, a solution that uses the Python C API (or a combination of Boost and the C API) is good as well. Since my other classes are exposed with Boost, I'd rather leave SWIG as a last resort.</p>
28
+
29
+
<p>Note: This is actually part of a bigger problem I'm trying to solve, which I've asked about in Setting metaclass of wrapped class with Boost.Python, if you're interested.</p>
30
+
</div>
31
+
<aside>
32
+
Categorie: <ahref="#">category name</a> · Data intrebarii: <timedtime="12-12-2012">acum 5 ore</time> · Intrebat de: <ahref="mailto:[email protected]">Silviu Postavaru</a>
<p><strong>Mixing Table-Entities with View-Entities is ok and largely depends on your requirements.</strong></p>
41
+
<p>My experience has been these are things you are going to have to deal with.</p>
42
+
<p>When I first started using Entity, I used views a lot because I was told I needed to use them. As I became more familiar with Entity I began to <em>prefer</em> the use of table-entities over view-entities; mainly because I felt I had more control. Views are ok when you are presenting read-only info, or as you described (flattend data, pivots, joins etc.); however, when your requirements change and you now have to add CRUD, you are going to have to use stored procedures or change your model to use table-entites anyway, so you might as well use table-entities from the start.</p>
43
+
<blockquote>
44
+
<p>The Views contains lots and lots of Keys. Some quick googling seems to
45
+
indicate I will need to manually edit the EDMX file to remove this
46
+
info.</p>
47
+
</blockquote>
48
+
<p><strong>This wasn't ever really a problem for me.</strong> You can undo keys of the view-entity in the designer. If your talking about doing this for the view in the storage layer, then yes, you can, to make it work, but as soon as you update your model from the database, you are going to have to do this over again -- I wouldn't recommend doing this. You are better off working with your DBA to adjust the key constraints in the database.</p>
49
+
<blockquote>
50
+
<p>The Views don't have any relationships to the other table entities.
51
+
These associations need to be manually added in order to link a View
52
+
-> Table.</p>
53
+
</blockquote>
54
+
<p><strong>This was <em>often</em> a problem for me.</strong> Sometimes you are able to add keys and create relationships without any problems, but often times you may have to change the keys and/or relationships in the db to make it work -- this depends on your requirements; you may have to deal with this even when using table-entities.</p>
<p>My experience has been these are things you are going to have to deal with.</p>
65
+
<p>When I first started using Entity, I used views a lot because I was told I needed to use them. As I became more familiar with Entity I began to <em>prefer</em> the use of table-entities over view-entities; mainly because I felt I had more control. Views are ok when you are presenting read-only info, or as you described (flattend data, pivots, joins etc.); however, when your requirements change and you now have to add CRUD, you are going to have to use stored procedures or change your model to use table-entites anyway, so you might as well use table-entities from the start.</p>
66
+
<blockquote>
67
+
<p>The Views contains lots and lots of Keys. Some quick googling seems to
68
+
indicate I will need to manually edit the EDMX file to remove this
69
+
info.</p>
70
+
</blockquote>
71
+
<p><strong>This wasn't ever really a problem for me.</strong> You can undo keys of the view-entity in the designer. If your talking about doing this for the view in the storage layer, then yes, you can, to make it work, but as soon as you update your model from the database, you are going to have to do this over again -- I wouldn't recommend doing this. You are better off working with your DBA to adjust the key constraints in the database.</p>
72
+
<blockquote>
73
+
<p>The Views don't have any relationships to the other table entities.
74
+
These associations need to be manually added in order to link a View
75
+
-> Table.</p>
76
+
</blockquote>
77
+
<p><strong>This was <em>often</em> a problem for me.</strong> Sometimes you are able to add keys and create relationships without any problems, but often times you may have to change the keys and/or relationships in the db to make it work -- this depends on your requirements; you may have to deal with this even when using table-entities.</p>
This work is licensed under a <arel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License</a>.<br/>
0 commit comments