Tagged Questions
0
votes
0answers
70 views
How to implement multi-theme PHP application
I am developing an application which will handle many virtual stores and I would like to have many themes that the user could choose anytime. I would to know what's the main ideia to implement it. I ...
4
votes
3answers
312 views
Is it acceptable for child classes to “break” parent class functionality?
One of the devs that works with me is following the Open/Closed Principle to add functionality to a Model by extending from our framework ORM.
class BaseModel extends ORM {
...
}
All our models ...
4
votes
2answers
341 views
Can REST API be used as business layer?
I am using PHP Codeigniter MVC design pattern
and I had this project with some sort of specific business processes
In my application I will be dealing with 2 existing REST APIs:
Google
Trello
...
-1
votes
3answers
144 views
Changing behaviour of abstract class without modifying subclasses
I am facing a problem with changing behaviour of a library (thus cannot or don't want to change its internals because of future updates, etc.).
In this library there is an abstract class which shares ...
1
vote
1answer
265 views
What is a practical level of abstraction in a web application? [closed]
(Originally asked on StackOverflow - http://stackoverflow.com/questions/14896121/what-is-a-practical-level-of-abstraction-in-a-web-application)
I still consider myself a newcomer to OO programming, ...
6
votes
4answers
275 views
Applying DRY to an inheritance hierarchy
I'm working on refactoring a legacy application where I implemented the State pattern successfully as shown in the following diagram:
As you see there is a common behavior between the 3 states, so ...
8
votes
4answers
433 views
In MVC, can/should basic data retrieval from the Model be done in the View?
Given the concept of 'skinny controllers, fat models' and the general acceptance that Views can directly call on Models when requiring data for output, should one consider handling the 'get and ...
2
votes
2answers
369 views
Service layer design
I am developing an MVC website in PHP, and for the first time, I would like to implement a service layer. I have some design considerations I would like to get some advice on. The backend will by no ...
15
votes
3answers
615 views
How to design website workflow?
I have been thinking about this for really long time without reaching an optimum answer.
First of all, I'm a medical doctor who loves programming but never really studied it, except for home learning ...
-1
votes
1answer
119 views
Web App architectural design, help me stop buying more servers to scale up! [closed]
Background: I am part of a small dev team, I am not the lead\senior developer. The lead developer is very knowledgable and I trust his decision making but I am starting to wonder if we could improve.
...
1
vote
1answer
138 views
Is there a good design pattern for this messaging class?
Is there a good design pattern for this?
I want to create a messaging class.
The class will be passed:
the type of message (eg. signup, signup confirmation, password reminder etc)
the client's id
...
3
votes
2answers
589 views
Using PDO with MVC
I asked this question at stackoverflow and received no response (closed as duplicate with no answer). I'm experimenting with OOP and I have the following basic MVC layout:
class Model {
// do ...
0
votes
4answers
481 views
Should I use the factory design pattern for every class?
I've been writing a website in PHP. As the code becomes more complex, I keep finding problems that can be solved using the factory design pattern. For example: I've a got a class Page which has ...
2
votes
4answers
294 views
Would Using a PHP Framework Be Beneficial in My Context?
I've just started work at a small start-up company who mainly uses PHP to develop their front-end apps. I had no prior PHP experience before joining, and this has led to my apps becoming large pieces ...
2
votes
1answer
137 views
How can I design my classes to include calendar events stored in a database?
I'm developing a web calendar in php (using Symfony2) inspired by iCal for a project of mine.
At this moment, I have two classes: a class "Calendar" and a class "CalendarCell".
Here you are the two ...
4
votes
4answers
342 views
Best Method of function parameter validation
I've been dabbling with the idea of creating my own CMS for the experience and because it would be fun to run my website off my own code base.
One of the decisions I keep coming back to is how best ...
6
votes
2answers
307 views
How to use DI and DI containers
I am building a small PHP mvc framework (yes, yet another one), mostly for learning purposes, and I am trying to do it the right way, so I'd like to use a DI container, but I am not asking which one ...
4
votes
7answers
3k views
Is there any design pattern except MVC for web?
I want to know are there any design patterns for web besides MVC?
I know there are design patterns as: Registry, Observer, Factory, ActiveRecord ,... and MVC a set of other design patterns and folder ...
0
votes
4answers
288 views
Is it better to find issues myself or let the computer figure it out?
I'm about to start the process of migrating a program from one component to another. Most of the core functionality will be the same but I'll need to change database calls, etc. I'm sure there will ...
2
votes
1answer
356 views
A solution for a PHP website without a framework
One of our customers asked us to add some dynamic functionality to an existent website, made of several static HTML pages.
We normally work with an MVC framework (mostly CodeIgniter), but in this ...
0
votes
1answer
97 views
The design of a generic data synchronizer, or, an [object] that does [actions] with the aid of [helpers]
I'd like to create a generic data-source "synchronizer," where data-source "types" may include MySQL databases, Google Spreadsheets documents, CSV files, among others. I've been trying to figure out ...
2
votes
2answers
974 views
Booking system (Handle working hours, Get available time slots) [closed]
I'm currently working on a time booking system for a friends hair salon. The plan is to try to keep it as simple as possible.
The user view (where the owner see the booked appointments) is more or ...
6
votes
4answers
512 views
Design pattern for handling a response
Most of the time when I'm writing some code that handles the response for a certain function call I get the following code structure:
example: This is a function that will handle the authentication ...
4
votes
2answers
200 views
Help needed with class design and structure
This question is mostly about the best way to approach this problem. Any input is appreciated.
The Problem
In my application i need to send some data to a number of different destinations (we will ...
2
votes
2answers
127 views
Extensibility data model pattern
I was wondering how you'd be able to map the following criterias to common design patterns. I use PHP 5.3 and MySQL 5.5 and have my own mvc framework for my company but some parts could be better and ...
1
vote
3answers
345 views
Effective template system [closed]
I'm building a content management system, and need advice on which theming structure should I adopt. A few options (This is not a complete list):
Wordpress style:
the controller decides what ...
4
votes
2answers
397 views
PHP Aspect Oriented Design
This is a continuation of this Code Review question.
What was taken away from that post, and other aspect oriented design is it is hard to debug. To counter that, I implemented the ability to turn ...
5
votes
2answers
363 views
Designing web-based plugin systems correctly so they don't waste as many resources?
Many CMS systems which rely on third parties for much of their code often build "plugin" or "hooks" systems to make it easy for developers to modify the codebase's actions without editing the core ...
3
votes
1answer
410 views
How is the facade pattern different from abstraction layers?
I just read about the facade pattern and found this example where a client (user of a computer) invokes a startComputer() method which calls on all the complex stuff:
Source: wikipedia
/* Complex ...
2
votes
2answers
166 views
ResourceSerializable: an alternate to ORM and ActiveRecord
A few opinionated reasons I don't like the traditional ORM and ActiveRecord patterns:
They work only with a database. Sometimes I'm dealing with objects from an API and other objects from a ...
5
votes
1answer
491 views
Object oriented EDI handling in PHP
I'm currently starting a new sub project where I will:
Retrieve the order information from our mainframe
Save the order information to our web-apps' database
Send the order as EDI (either D01b or ...
7
votes
4answers
309 views
OOP design question
I'm working on an application written in PHP using OOP principles. The classes in my application usually represent a table in the database; for instance, 'student', 'teacher', 'class', 'schedule', ...
1
vote
2answers
1k views
Anemic Domain Model, Business Logic and DataMapper (PHP)
I've implemented a rudimentary ORM layer based on DataMapper (I don't want to use a full blown ORM like Propel/Doctrine - for anything beyond simple fetch/save ops I prefer to access the data directly ...
2
votes
4answers
729 views
How to learn the practical uses of design patterns
I use OOP programming with inheritance, but I've not yet used interfaces.I want to learn how to use design patterns, but I'm finding them very difficult to learn. Is there is any way to learn design ...
1
vote
1answer
166 views
PHP objects with configurable data interfaces
I have a User class which needs to load data from a variety of sources, e.g. the main user database, WordPress user metadata, authorizations from another app, etc. For the sake of organization, I want ...
