The models tag has no wiki summary.
4
votes
2answers
105 views
Need a review for a function that returns the 3 latest dates
Just putting together a small project, checking to see if this would be the fastest/cleanest way to write out a function that grabs the 3 latest vital signs.
Edit: I am thinking GetRecentVitalSigns ...
1
vote
1answer
91 views
How to observe nested objects
By having two model classes Conversation and Message, what are the best practices to handle the next situation: A conversation listening for its messages PropertyChanged events and so being able to ...
0
votes
1answer
125 views
PHP MVC: how to do $_POST the right way
I am not sure if I am doing right on how to handle $_POST data in MVC pattern. Below is my attempt. Am I doing it right?
// Dummy $_POST data,
$_POST = array(
"menu" => array(
...
1
vote
1answer
81 views
Programming a simple clock
Here's the beginnings of some code for a clock that can display in 24 and 12 hours.
What could be added to it ? How could I can apply notions such as OOP, model and Enums here ?
P.S: Will edit later ...
3
votes
2answers
66 views
How to avoid goto without replicating code in my meshing algorithm?
To generate faces of a Minecraft-like world from a three dimensional array, I developed the following meshing algorithm. The faces are given vertices and indices. A vertex consists of a position in ...
1
vote
1answer
43 views
Defining models in GAE
I'm learning to work in GAE. I'm so used to SQL, but transform my way of think the last 20 years to NoSQL is a little hard for me.
I have the next simple structure:
BOOKS than can have CHAPTERS
...
1
vote
1answer
283 views
Router Class In a Lightweight MVC Boilerplate
I'm trying to come up with a simple router class. I considered using a Request class but that will rather make simple to complex. That is why I did not consider creating one for my framework.
class ...
1
vote
0answers
59 views
Meta programming: dupping Rails model
Can someone please review my code:
# dup/ish -> //github.com/rails/rails/issues/5449
class Form
include Mongoid::Document
attr_accessor :source
def self.ish(prefix, suffix, &block)
...
2
votes
0answers
72 views
Models in .NET: separate settings?
For my models for a certain section I thought it would be better to have a base class model for both "view" and "edit" models, like so:
public abstract class Setting
{
[Required]
public int ...
6
votes
2answers
220 views
Where should I define my entities?
I am working on my own PHP MVCframework. Now I want to know where to get and specify my entities.
An example, should I do this:
class User_Model extends Model {
private $name;
public getName() {}
...
1
vote
0answers
94 views
Data model with validation in haskell couple convoluted functions
So I'm curious about a few things that I did here design wise, as well as one space I'm sure I can be given improvements from real haskellers.
The part I really think can be done better that I'm ...
3
votes
1answer
186 views
Is my ERD design for “Adding Friends Capability” is good enough? [closed]
I have a school project to create a simple networking site, And I want to know if my database design is good. I'm open for any suggestions to improve my design thanks!
3
votes
1answer
120 views
Semi-Repost: How can I improve my PHP model for my html5/js mobile app?
I was advised, rightfully so, to simplify my question.
I am posting the a section of the model of my application.
Any/all feedback would be very helpful as I am trying to build my PHP skills, but I ...
1
vote
2answers
75 views
How can I refactor this oversized Ruby method into smaller bits and have unit tests for them?
This is the existing code. Clearly way too much is going on in this index method and furthermore it's untested (and hard to test in its current form).
def index
# @s = ""
# @now=DateTime.now
...
1
vote
2answers
72 views
Doubts about db_index, primary_key and unique parameters
I'm trying to improve my code. I've some doubts about db_index, primary_key and unique parameters.
# -*- coding: UTF-8 -*-
from django.db import models
from django.contrib.auth.models ...
3
votes
1answer
244 views
Polymorphism in Django models
For flexing my newly acquired Django & Python muscles, I have set up to do a mobile content delivery system via Wap Push (Ringtones, wallpapers, etc), old fashion but it is an exercise!
I have a ...
-1
votes
1answer
448 views
Can you review 1 line of code here?
Hi I hope you can comment when I include the largest file of my largest project. There is more available if you feel like code review. I think my project needs daily code review for some time. The ...
0
votes
1answer
558 views
Does my Entity Framework 4 Model-First design look ok? Any issues? [closed]
I'm very new to entity framework and I've found model-first design is a more preferred way for generating a relational diagram, rather than reverse-engineering an existing schema.
I've designed my ...
2
votes
2answers
267 views
How skinny should controllers be, how fat should models be in CakePHP?
I know it's a good idea to put all data-related logic in your models in CakePHP, but what would you say about keeping every Model::find() and its particular params in the model? Is this good practice, ...
1
vote
1answer
154 views
Loading module to a templated page.
Hi there!
I am trying to create a web app (CMS) as part of my research project, and I use the code below to load modules into a page, It will be great to have your guys review and critics
...
4
votes
2answers
1k views
WPF MVVM confusion
I have been trying to wrap my head around mvvm for the last week or more and still struggling a bit. I have watched Jason Dolingers MVVM video and gone through Reed Copsey lessons and still find ...
5
votes
1answer
5k views
how to filter (search) a model with multiple params in hash
this function in my Profile model receive a hash from a search form and should filter the table depending on those values. I guess there is something like a pattern for such a standard behavior, right ...
5
votes
2answers
861 views
Critique My Codeigniter Custom CMS Pages Model
I am currently developing a custom CMS being built on top of Codeigniter and was wondering if you can spot any flaws in my page fetching model code. The page fetching model is not entirely complete ...