Design Pattern for class bookings - oop

I am designing a small application to manage class sign-ups and appointment bookings within a school.
I will have students who will want to book classes, Teachers who teach classes in the room and also have an office room and guests will book in meetings with teachers in one of their rooms.
I will also need to print out a report of all meetings and classes and which rooms and who attended.
Which design patterns would be best?
I have been looking at possibly the Factory/ iterator and composite so far but not sure which would be most suitable or what the potential issues that might arise?

Essentially you have rooms, time slots, and you have to assign them to resources. This is a typical Constraint Satisfaction Problem (CSP). There are many ways to solve such kind of problems. One is backtracking algorithm. There is another approach called Genetic Algorithm that helps you pick up the best solutions. Please search those.
Thanks.

Related

Component Teams or Feature Teams

I am an experienced product person however I keep on finding myself in the same old argument component teams or cross-functional feature teams.
What are the pros and cons of Feature and Component teams?
Does its matter at what stage of growth the business is?
A common argument against feature teams is that there is no single ownership of services is this a problem? in my mind specializing is not a good idea.
Thank you
Cross-functional feature teams:
Few external dependencies
Able to directly equate the work they do to customer value
Rarely a bottleneck or lacking in work
Challenges balancing the load on specialists in the team
Specialists in the team may feel 'isolated' from others with similar skill sets
Component teams:
Often have external dependencies or other teams depend on them
Hard to evaluate their work as it is a piece in the puzzle rather than end user value
Lots of team members with similar skill sets, so knowledge sharing, etc. is good

What is objectville in the head first series books?

I am reading the head first design pattern book.
I've seen objectville word many times in this book.I guess the meaning of the word is a group of objects.
what's meaning of the objectville exactly?
Objectville is a fictional place (think Smallville) that they use to describe the concept of object oriented items.
what i found in safaribooksonline
Get ready to take a trip to a foreign country. It’s time to visit Objectville, a land where objects do just what they’re supposed to, applications are all well-encapsulated (you’ll find out exactly what that means shortly), and designs are easy to reuse and extend. But before we can get going, there are a couple of things you need to know first, and a few language skills you’re going to have to learn. Don’t worry, though, it won’t take long, and before you know it, you’ll be speaking the language of OO like you’ve been living in the well-designed areas of Objectville for years.

References on best practices for registration keys/access codes format

I am developing an online site to which access will be sold at college bookstores. Students will purchase a card at the bookstore with an access code that they may then use to register online at our site.
I want to make the code as user friendly as possible. I personally hate registering for a product and having to type in a registration key 5 times because it's ambiguous.
Can anyone point me to resources describing best practices for designing the format of the code itself? Obvious things spring to mind-- don't use zeroes or the letter O, don't make it case sensitive, include some kind of checksum. I don't want to be creative here, I need a recipe for what must be a problem solved many times.
Joel Spolsky had some good insights to solving this problem in one of the recent StackOverflow podcasts. I believe the episode was #49, you should download podcasts or checkout the transcripts at https://stackoverflow.fogbugz.com/default.asp?W4
Dealing with 0 (number) and O (letter) mixed in a key is really annoying as some fonts make it hard to distinguish the two.
Other usability concepts such as groups of three being easier to deal with and remember then a single number are good to be aware of. For example, 345-829-817-432 instead of 345829817432.
By the way, 345-829-817-432 gives you 12^10 permutations, and even the smaller number 345-829-817 gives you 9^10 permutations which may give you enough strength depending on your situation.
tschüss,
bn
It really depends on how much security you need. A few ideas come to mind.
If you want something really simple you could generate simulated credit card numbers; students are adept at using these four-digit combinations, and they can be checked with a Luhn algorithm.
If you want something a little stronger you could generate a GUID, and use that as the code.
If your website can send emails you can ask the student for their email address, and send them a challenge/response email. Then you don't need codes at all. Their email address is the code.

Teaching systems analysis and design - how much programming experience is needed? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I teach a one semester University course in systems analysis and design. Topics include design patterns, UML, OOP, software development lifecycles, and the history, benefits and drawbacks of various methodologies (such as Agile/SCRUM/BDUF/Waterfall.)
Students who enter the course should have some exposure to programming, but in reality I've seen everything from people who are highly fluent in one or two modern languages to those who can barely pass the FizzBuzz test.
My question is two-fold: how much programming experience do you think students need before exposure to these topics (or do you think they should learn them before they learn to code), and second, what do you feel would be fair and appropriate ways to pre-test them at the start of the class, knowing that there is no consistent language or platform in their background?
I think students learn best when they can put into practice the material that they are learning. To that end, I think the best course would include some project (or mini-projects) that would involve coding. Typically, I would expect this to be taught to upper-level undergraduates and graduate students. By this time, students should have had some programming classes, some discrete math, and a basic data structures course. While not technically pre-requisites (except for the programming class) if you could require these others you have a better chance of getting students with the proper background.
As far as a pre-test, I would suggest having some simple programming projects to illustrate design patterns/OOP early in the course. I'd be stricter, perhaps, with these projects than you might be tempted to be for assignments early in the class. Be up front that programming skill is required for the course and grade that way. Let people know, through your grading, that the requirement is serious.
This may sound harsh, but I've seen too many students make it through courses leaning on their project partners because they aren't able to keep up with the coding required. I don't think they've really gotten much out of the course because they didn't have a chance to internalize the knowledge through experience.
You can't teach students the solution to a problem they've never had. If you want students to be able to do something with this material, they have to have substantial programming experience, so that they have some inkling of the problems all these ideas are intended to solve.
Ask yourself why are you teaching this material and how do you want your students to have changed by the end of the term. If all you want is for them to be able to explain the concepts at the whiteboard, the amount of programming experience is less important. But the real goals depend on you: the more carefully you articulate your goals for the class, the more likely you are to achieve them. What do you hope to accomplish?
I've been in the same position, and I'm convinced that students ought to have significant programming experience, and some mathematical sophistication as well. At least a good, serious programming course, a data structures course, and maybe a computer organization or systems programming course.
I haven't had a formal computer science education, so I can't speak from that perspective, but I do feel that it takes a significant amount of programming experience to appreciate concepts such as design patterns.
Having gone through the hobby programming phases to taking programming seriously, I've found through experience that proper design makes highly maintainable code. I've experienced going from the spaghetti code of GOTOs in BASIC to utilizing design patterns and MVC methodologies and come to seriously appreciate coding based on good design.
Without the appropriate level of experience, the students will only see the course as "oh, so there are things like design patterns, that's nice" but it won't really strike home.
I also second post by tvanfosson and feel that having projects be an integral part of the course would really demonstrate how object-oriented programming and design patterns can be utilized to write well-designed, well-maintainable, reusable code.
I would say that it depends on your goals/purpose for the course, the target audience, and the outcomes.
On the face of it, you don't need ANY programming background to get a great deal out of such a course. After all, the methodologies and techniques are really about COMMUNICATION, not programming specifically. In fact, properly done, design can eliminate a whole lot of needless programming - even using Agile methodologies (that's why they are told to communicate with the client FIRST and FREQUENTLY).
Besides, properly targeted, this course could be a cross-over for many other programs, faculties and certifications; such as the various business degrees, management courses, etc. Wouldn't it be nice to have someone in "management" who had taken such a course and actually understood the need for proper client communication, instead of just focusing on what marketing wanted this week combined with the ususal too-short deadlines?
So I encourage you to think beyond "programmers" as the target audience for such a course. Think of this as a COMMUNICATION course first, and go from there.
Best wishes.
Cheers,
-Richard
when i was a student about 2 years ago. this kind of topics where better understood in the last courses. in order to grasp all this topics i think students must have at least 3 Programming courses (Structure Programming,OOP 1,OOP 2) a software engineering course will be great too and also some DB Background. try to encourage students to start a project from scratch (requirements gathering - Release) there is nothing better than practice-practice-practice
Coobird and Tvan are absolutely correct about needing a lot of time at programming. I will add that in a learning environment it is important to have both immediate feedback (other than getting the code to run) and a variety of situation to handle.
Nothing like eating your own dog food and being forced to clean up your own mess to get the point across.
I think there may be a basic computer programming course that could be given before such a course that introduces various basic ideas of modern programming, e.g. what is an IDE, what is an algorithm, what are basic ways to measure complexities, etc. where there are 2 choices given to the student: Use what the course suggests for a language, or pick your own from this list that TA's and others would know enough about to determine if the solution is acceptable or not. One issue to consider is whether or not various exotic languages like Logo, Lisp, Modula-3 or Fortran would be OK or not. The idea of understanding how to use various tools would be the focus more so than using a specific programming language that may not be used outside of academia.
In some respects the final exam for such a course would act as a way to determine whether or not one would be able to skip such a course. The main idea is to have some basics within a specific realm pinned down, not unlike how in elementary school an Arabic number system in base 10 with the operations of add, subtract, multiply and divide and place value, like tens, hundreds, etc. is the basics of Mathematics as opposed to having learned any of these as one's introduction to Mathematics, which are all possible starting points:
Trigonometry using a hexadecimal number base defining functions such as sine, secant, tangent as well as the co- of each and the inverse of all of those and the graphs of such functions.
Graph theory consisting of paths, breadth first search, depth first search, and minimum weight spanning trees.
Derivatives, integrals, and partial differential equations over the Complex Number system or some higher dimensional spaces like N x N matrices of real numbers.
Probability and Statistical theory including arithmetic and geometric mean, median, mode as well as the idea of least squares and linear regression with just enough Algebra so it all makes sense.
Finite Mathematics such as permutations, combinations, enumeration and asymptotes.
Modular arithmetic and floating point number systems.
Geometry of various shapes examining types of angles and parallel sides as ways to categorize various shapes. Also in here are the formulas for perimeter, area, surface area and volume for various shapes.
Sequences and series with the idea of limits and infinity as something special to bring to the class along with capital sigma for sums and pi for products.
Boolean algebra involving various logic gates such as AND, OR, XOR, and NOT in the form of truth tables.
Linear Algebra using only Matrices and linear transformations.
Logic problems similar to the board game Clue.
Pure Mathematics involving proofs of various Theorems and using a syntax full of abbreviations including the following: <=> as if and only if, => implies, backwards E for existence, backwards E followed by an exclamation point for there exists and is unique, upside down A as a "For all" or "For each" qualifier, three dots in one arrangement for "Therefore" and another for "Since," as well as ideas of necessary conditions compared to sufficient conditions as well as proof by Induction.
Algebraic concepts like groups, rings and fields. Here would also have the notion of inverses, associative and commutative operations.
Picture if one had a classroom of 30 students, 10 of which have a basic North American education and the other 20 each learned one of the 12 above parts of Mathematics but not necessarily the others. Could terms like "graph" be cases where more than one branch use the term with a very different meaning, e.g. graph of a function in the (x,y) plane versus a set of vertices and edges as a graph or net as in the 2-D representation of how to build various 3-D shapes? That would be a similar situation I believe.
I've been a programmer for a long time, and I wish I had learned proper system analysis at the beginning.
Properly analyzing a system and designing a solution is a fundamental step to creating the proper solution. Systems analysis methods gives you a foundation to build on. It is the blueprint. How can you build an app without proper planning? It can be done, but it is usually a mess. If I had a programming course this is what I would teach:
1.System Analysis and design.
2.Project Planning (PMI Institue) using MS Project. After aquiring these skills you can take on any programming job in a professional manner.
3.The programming solution (VB.NET, C#, C++, ASP.NET JAVA, etc) to create the design.
If you want to be a professional programmer then these are the basic skills you need. Unfortunately, I have not seen these items inforced in places I have worked. A good plan is always helpful.

OOP Problems to use for Coding Tests during interviews

As a second interview I get people to sit down and write code...I try to make the problem really technology independent.
My programming problems that I have don't really exercise peoples OO abilities. I tend to try and keep the coding problem solvable within 2 hours ish. So, I've struggled to find a problem small enough and involved enough that it exposes peoples OO design skills.
Any suggestions?
This is a problem that I use with some trainings, looks simple but is tricky OOP-wise:
Create model classes that will properly represent the following constructs:
Define a Shape object, where the object is any two dimensional figure, and has the following characteristics: a name, a perimeter, and a surface area.
Define a Circle, retaining and accurately outputting the values of the aforementioned characteristics of a Shape.
Define a Triangle. This time, the name of the triangle should take into account if it is equilateral (all 3 sides are the same length), isoceles (only 2 sides are the same length), or scalene (no 2 sides are the same).
You can go on and on with quadrelaterals (which include squares, rectangles, rhombi, etc) and other polygons.
The way that they would solve the above problems would reveal the people who understand OOP apart from those who don't.
ideally, you want to present a problem that appears difficult, but has a simple, elegant, obvious solution if you think in OO terms
perhaps:
we need to control access to a customer web site
each customer may have one or more people to access the site
different people from different customers may be able to view different parts of the site
the same person may work for more than one customer
customers want to manage permissions based on the person, department, team, or project
design a solution for this using object-oriented techniques
one OO solution is to have a Person, a Customer, an Account, and AccountPermissions, where the Account specifies a Person and a Customer and an optional Parent Account. the use of a recursive Account object collapses the otherwise cumbersome person/team/department/project structure a direct ERD solution might yield
I have used the FizzBuzz Programming Test. And shockingly can corroborate the claims made by the article. As a second follow up I have asked candidates to compute the angle(s) between the hands on an analog clock. We set up a laptop with VS 2008 installed and the stub in place. all they have to do is fill in the implementation.
I am always stunned at how poorly candidates do on these two questions. I really am.
Designing Social Security Application is something which I ask a lot of people during interviews.
The nice thing about this is everyone is aware of how it works and what things to keep track of.
They also have to justify their design and this really helps me get inside their head :)
(As there is lots of flexibility here)
Kind regards,
Whether or not people do some coding in the interview, I make it a point to ask this:
Tell me about a problem you solved recently using object oriented programming. You'd be surprised how often people cannot answer that simple question. A lot of times I get a blank stare, or they say something like "what do you mean? I program in .NET, which is all object oriented."
These aren't specifically OO Questions, but check out the other questions tagged interview-questions
Edit: What about implementing some design patterns? I don't have the best knowledge in the area but it seems as if you would be getting two questions for the price of one. You can test for both OO and Design pattens in the one question.
How about some sort of simple GUI. It's got inheritance, overriding, possibly events. If you mean for them to actually implement as part of the test then you could hand them a blank windows-form with an OnPaint() and tell them to get to it.
You could do worse than ask them to design a MapReduce library with a single-process implementation. Will the interface still work for a distributed implementation? What's the exception-handling policy? Should there be special support for chaining MapReduce jobs in a pipeline? What's the interface to the inputs and outputs? How are inputs chunked up? Can different inputs in one job go to different mappers? What defaults are reasonable?
A good solution in Python takes about a page of code.
I've got a super simple set. The idea is mainly to use them to filter out people who really don't know their stuff rather than filtering in the rock stars.
These are all 5 minute white-board type questions, so they are really not that hard. But the act of writing up code, and talking through it reveals a lot about a candidate - and is brilliant for exposing those that can otherwise BS through the talk.
Write a method that takes a radius of a circle as an argument, and returns the area of the circle (You would be amazed how many people struggle on this one!)
Write a program that accepts a series of numbers as arguments from the command line. Add them up, and print the sum
Write a class that acts as a keyed counter (basically a map that keeps track of how many times each key is "counted")