Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 is this considered poor software design?

views
     
TSFLampard
post Aug 18 2023, 10:49 AM, updated 3y ago

On my way
****
Junior Member
590 posts

Joined: Jun 2008
i am working on a project

i pulled the code, installed all the modules, then run migration, then run seed

then there was an error during seeding, so i unseed it, and then rerun seed

then when run software, suddenly the software got error

i investigated. and then found out what went wrong

the software relies on rows obtained from a certain sql table and rely on the auto-increment primary key for configuration

for eg, its like (just example)

theme_table

id | theme

0 | dark

1 | light

when you unseed it, and then re-seed it. the auto increment kicks in and then repopulated to increasing id

now become

theme_table

id | theme

2 | dark

3 | light

since the software cant find 1 and 2, and it is coded to find 1 and 2 only. it returns error.

i ask the others they dont have the problem because they have only seeded it once.

i am meeting up with the team on saturday. can i raise this as poor software design?
flashang
post Aug 18 2023, 12:30 PM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


May be :
* Less consideration / auto or default configuration.
* Lack of error handling.
* Lazy to do complex settings.

* other reasons...

smile.gif



This post has been edited by flashang: Aug 18 2023, 12:31 PM
angch
post Aug 18 2023, 12:47 PM

On my way
****
Junior Member
636 posts

Joined: Jul 2006
Just a buggy implementation. Just add a
CODE
make clean
step before your seeding step, test, commit, send pull request and move on.

Should be faster and more productive for everyone.

This post has been edited by angch: Aug 18 2023, 12:49 PM
silkworm
post Aug 18 2023, 08:19 PM

Enthusiast
Group Icon
Elite
965 posts

Joined: Jan 2003
From: Kajang


I'd attribute the OP's troubles to a buggy seed/unseed script instead of as a design problem. After all, it had one job: put the system in a known working state after a fresh install, and it failed!

Unless the "Developer Experience" is one of the project's goals, implementing anything more elaborate puts one squarely into "over-engineering" territory.

flashang
post Aug 19 2023, 10:08 AM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


QUOTE(angch @ Aug 18 2023, 12:47 PM)
Just a buggy implementation. Just add a
CODE
make clean
step before your seeding step, test, commit, send pull request and move on.

Should be faster and more productive for everyone.
*
they can reduce bugs by using order by id limit 1,
show proper error 'cannot get setting from table x'

or set default value if no 'custom settings'.

it helps dev and ops teams to check where is the problem.

smile.gif



This post has been edited by flashang: Aug 19 2023, 10:09 AM
TSFLampard
post Aug 21 2023, 10:56 AM

On my way
****
Junior Member
590 posts

Joined: Jun 2008
problem solved for all the tables that suffers from this
i just implemented an id in the seeding process to force a value we want on it
silverhawk
post Aug 21 2023, 04:54 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


If its seeding for a local dev environment, then its not necessarily bad. As any errors that show up coulld indicate you did not do the set up properly.

Since you said config relies on the ID value, it also stands to reason you should be able to update the config?
iammyself
post Aug 21 2023, 06:42 PM

Getting Started
**
Junior Member
238 posts

Joined: May 2011
It's a bug but personally I don't think it's a problem.

In terms of impact, it's negligible. It's not affecting production, staging, or even other developers.

That said, you did the right thing with the fix. So good job right there.

 

Change to:
| Lo-Fi Version
0.0163sec    0.34    5 queries    GZIP Disabled
Time is now: 24th December 2025 - 07:21 AM