July 16th, 2012, 02:07 PM
Join Date: Jul 2012
Time spent in forums: 1 h 44 m 54 sec
Reputation Power: 0
I have a general analyze related question :S
Warning--long post ahead.
Well I am doing a project in asp.net c# language but the question is more general.
Ok I don't really know how to explain it so I will start with examples :S
Basically I want to know where to put what (classes responsibilities-which class should or should not do what).
I have 1 project named BL.
Which holds all the entities (user,subject,lesson,exercise)
and the directors (userdirector,ex_director etc)
And a main project which holds the rest(registration,login,lesson_edit.....)
the subject entity contains a list of lessons.
the lesson entity contains int field for the lesson's subject_id.
(they got more fields but these are the important ones)
in the main project I got a class called globals which holds 2 static lists:
I have a list of subjects which contains a list of lessons.
I have a list of lessons and each lesson has a field with its subject_id.
(in other words 2 lists 1 of lesson objects and the other subject objects)
(example how things should look or more like how I want them to b):
Now, I have a user entity and userdirector.
The userdirector is responsible for the validation and saving to db.
the info for that is sent by the class (in the main project) registration which calls for validating (calls userdirector's functions).
So this is all and good but there is no user list so this is where I am lost.
I want to create the same thing for lesson and subject I will anyway create LessonDirector and LessonSubject so they can validate and save into db and what not.
Currently I have other classes that do that (like the class that edits the lesson saves it into db and is located in the main project-I want to change it so the BL project deals with the db and only the BL).
My question is (sorry about the long explanation I really dunno how to explain it better)
I have the globals that communicate with the DB(in the BL project) and builds the static lists (which are dropped only when application closes) is that ok? or I have to separate them?
Should I save the lessons list in the lessonDirector and the subject lists in the subject director? (if possible)
They will stay global (I will make them static)
Who's job is to keep the list :S
Someone created this global class for me he meant to keep all the globals there so it kinda means all the lists.
But then I have 2 classes communicating with the DB and I want to make it 1.
Again sorry for the long post I hope I didn't lose you in the way somewhere...