model

UML: modeling an activity that creates/changes other activities

Let's say I am to build a behavioral model of some organization: in particular, I am to build a bunch of activity diagrams that describe all those activities that take place in the organization (activities like "bidding", "order fulfillment", "shipping", etc.). Now, one of the key activities in the organization is the one that includes ...

Something about my ADO.Net Entity Data Model is causing it to give my app an Internal Server Error...

I was trying to use ajax to retrieve data from a repository using a controller and I kept getting Internal Server Errors... I've whittled it down to the line: private MyDBEntities _myDB = new MyDBEntities(); That's located in the repository, without that line I don't get the Internal Server Error. The line is called after the Reposito...

Problem with two tables with the same name in different MVC models?

I've got an ASP.NET MVC (VB) project with two models that represent two different databases. Each model needs to include a table from its database with the same name. For example, model1.dbml needs to have db1.MyTable in it, and model2.dbml needs to have db2.MyTable in it. I can't do this because both models try to create a "Partial Pub...

DJANGO - How do you access the current model instance from inside a form.

class EditAdminForm(forms.ModelForm): password = username.CharField(widget=forms.TextInput()) password = forms.CharField(widget=forms.PasswordInput()) password_confirm = forms.CharField(widget=forms.PasswordInput(), initial=???) You can see what I'm trying to do here. How would I go about pre-populating the pasword_confirm ...

Model Framework for Actionscript 3.0

What is Model Framework for Actionscript 3.0? ...

Django - how to let one application reference another

Hello, i have two Django apps in my Project, call them App1 and App2. App1 is the "Home"-application that displays a text to introduce users and shows some news. App2 is a "Content"-app to display pages that only consist of a title and some html retrieved from the DB. I want App1 to display it's text using the model from App2. I can do ...

Calling ViewModel Methods

I'm pretty new to WPF and using the MVVM design pattern. To help learn this, I'm developing a simple dice-rolling application. Right now, I have a Dice class and a DiceViewModel class. I also have a MainWindowViewModel class that contains an observable collection of DiceViewModels. When a user clicks the "Roll" button, it launches a ...

Python Memory Model

I have a very large list Suppose I do that (yeah, I know the code is very unpythonic, but for the example's sake..): n = (2**32)**2 for i in xrange(10**7) li[i] = n works fine. however: for i in xrange(10**7) li[i] = i**2 consumes a significantly larger amount of memory. I don't understand why that is - storing the big number t...

Non Linq2Sql Model Binding examples in ASP.NET MVC

I notice a lot of the examples for ASP.NET use Linq2Sql as the datasource. Are there any examples out there which show how do use model binding with a non-Linq2Sql datasource, ie a dataset, or (as in my case) a generic list/collection of items based on a custom business object? ie public class WebsiteList : List { public WebsiteLi...

Zend Framework ORM-style table data gateway vs. extending Zend_Db_Table_Abstract

In the Zend Framework Quickstart, there has been a change from models that extend Zend_Db_Table_Abstract to the Table Data Gateway pattern. Personally, I have not had much experience with this pattern and I keep hearing this should most likely be used instead of the old way. A short example from the quickstart: Old way: class Default...

C#: How would you suggest to refactor these classes? (Interfaces, Aggregation or anything else)...

Having the following classes, in two different assemblies: class Member { public string Label {get;set;} // Lots of other fields... public double Thickness {get;set;} public double Width {get;set;} public double Length {get;set;} public double GetVolume () { return Thickness * Width * Length; } ...

ASP.net and CustomModelBinder and a prefix

With the default ModelBinder and its attribute Bind we can set a prefix like this: public ActionResult Save([Bind(Prefix="test")] Person p)) { } I have a CustomModelBinderAttribute which returns a bespoke ModelBinder: public ActionResult Save([PersonBinderAttribute(Prefix="test2")] Person p)) { } How do I access the value of Pref...

What datastructure would you use to represent this format of data?

I have to write kind of a complicated query to get some statistics for the rules in our system for each Agency we have in our database. It looks something like this: There will be an arbitrary number of columns (rules) and rows (agencies) for this data. For example, here there are 5 main rule columns shown, but this could just as eas...

Is it bad for performance to have an App Engine expando model with a huge number of properties?

I've been using a pattern in an application where I'm setting arbitrary attributes on Expando class models in an App Engine app. This works as expected, but hasn't yet been tested with a really large data set. And over time, the number of attributes might get to be > 1000. It also makes the table in the administration console scroll fa...

How should my MVC Model work with my Business logic classes?

So I have a MVC app and in another project I have a normal collection of classes which handle the Business and Data logic for the application. I also have some logic in the Model of the MVC project itself. This logic handles ViewModels and the like, things which could not have been done in the n-tier project as they relate to the MVC pro...

Get the graphics card model?

hi all, I was wondering how I can get the graphics card model/brand from code particularly from DirectX 9.0c (from within C++ code). Thanks for any help! ...

Django Model Inheritance and limit_choices_to

Can anyone tell me how i can limit the choices for the Page model which i inherit from in the following code? class CaseStudy(Page): """ An entry in a fancy picture flow widget for a case study page """ image = models.ForeignKey(Image, limit_choices_to={'is_active': True, 'category__code':'RP'}) def __unicode__(se...

.NET MVC Multiple Versions of Same form on One View

I have a section of my site where users can add addresses to their account. They may add as many as they need (shipping, billing, etc). I set things up so that after an address is added, the users sees the address in an update form with a "save" and "delete" button. The user can adjust any of the addresses they have added. The proble...

Entity-Framework: How to create a model from a disconnected dataset?

Using EF, is it possible to create the model from a disconnected dataset? Keep in mind that there is no "database", only a dataset. ...

Am I breaking my aggregate boundaries?

I'm modeling a very basic ASP.NET MVC app using NHibernate and I seem to be stuck on my design. Here's a sketch of my model: As you can see this is VERY basic but I have some concerns about it. The User root entity and the Organization root entity are accessing the same Organization_Users entity child via two one-to-many relationship...